<!doctype html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>CentriMo</title>
    <script type="text/javascript">
      //@JSON_VAR data
      var data = {
        "version": "5.0.2",
        "revision": "a40a52a93b6dce029c34699a737ea432925cfe33",
        "release": "Thu Aug 30 14:26:08 2018 -0700",
        "program": "CentriMo",
        "cmd": [
          "centrimo", "-seqlen", "300", "-verbosity", "1", "-oc",
          "meme/meme-chip_TCP7_2/centrimo_out", "-bfile",
          "meme/meme-chip_TCP7_2/background",
          "meme/meme-chip_TCP7_2/TCP7_2.meme.fa",
          "meme/meme-chip_TCP7_2/meme_out/meme.xml",
          "meme/meme-chip_TCP7_2/dreme_out/dreme.xml"
        ],
        "options": {
          "cd": false,
          "neg_sequences": false,
          "xalph": "",
          "bfile": "meme/meme-chip_TCP7_2/background",
          "motif_pseudo": 0.1,
          "seqlen": 300,
          "use_lo_fraction": false,
          "use_pvalues": false,
          "score": 5,
          "optimize_score": false,
          "minbin": 0,
          "maxbin": 0,
          "norc": false,
          "sep": false,
          "flip": false,
          "local": false,
          "ethresh": 10,
          "noseq": false,
          "mcc": false
        },
        "seqlen": 300,
        "tested": 10,
        "alphabet": {
          "name": "DNA",
          "like": "dna",
          "ncore": 4,
          "symbols": [
            {
              "symbol": "A",
              "name": "Adenine",
              "colour": "CC0000",
              "complement": "T"
            }, {
              "symbol": "C",
              "name": "Cytosine",
              "colour": "0000CC",
              "complement": "G"
            }, {
              "symbol": "G",
              "name": "Guanine",
              "colour": "FFB300",
              "complement": "C"
            }, {
              "symbol": "T",
              "aliases": "U",
              "name": "Thymine",
              "colour": "008000",
              "complement": "A"
            }, {
              "symbol": "N",
              "aliases": "X.",
              "name": "Any base",
              "equals": "ACGT"
            }, {
              "symbol": "V",
              "name": "Not T",
              "equals": "ACG"
            }, {
              "symbol": "H",
              "name": "Not G",
              "equals": "ACT"
            }, {
              "symbol": "D",
              "name": "Not C",
              "equals": "AGT"
            }, {
              "symbol": "B",
              "name": "Not A",
              "equals": "CGT"
            }, {
              "symbol": "M",
              "name": "Amino",
              "equals": "AC"
            }, {
              "symbol": "R",
              "name": "Purine",
              "equals": "AG"
            }, {
              "symbol": "W",
              "name": "Weak",
              "equals": "AT"
            }, {
              "symbol": "S",
              "name": "Strong",
              "equals": "CG"
            }, {
              "symbol": "Y",
              "name": "Pyrimidine",
              "equals": "CT"
            }, {
              "symbol": "K",
              "name": "Keto",
              "equals": "GT"
            }
          ]
        },
        "background": [0.278, 0.222, 0.222, 0.278],
        "sequence_db": {
          "source": "meme/meme-chip_TCP7_2/TCP7_2.meme.fa",
          "count": 3000,
          "skipped": 0
        },
        "motif_dbs": [
          {
            "source": "meme/meme-chip_TCP7_2/meme_out/meme.xml",
            "count": 5
          }, {
            "source": "meme/meme-chip_TCP7_2/dreme_out/dreme.xml",
            "count": 5
          }
        ],
        "sequences": [
          "contig_3:26456-26756", "contig_3:37233-37533",
          "contig_1:168933-169233", "contig_3:49256-49556",
          "contig_3:13917-14217", "contig_1:73650-73950",
          "contig_1:31792-32092", "contig_1:103217-103517",
          "contig_1:46348-46648", "contig_1:68919-69219",
          "contig_1:98171-98471", "Fvb1:20727478-20727778",
          "Fvb2:13922430-13922730", "contig_3:7129-7429",
          "Fvb2:1955115-1955415", "Fvb1:13390642-13390942",
          "Fvb1:23214080-23214380", "Fvb4:17737323-17737623",
          "Fvb4:17775125-17775425", "Fvb2:6530274-6530574",
          "Fvb4:13869604-13869904", "Fvb5:23650871-23651171",
          "Fvb6:7232265-7232565", "Fvb4:24980112-24980412",
          "Fvb4:9671687-9671987", "contig_1:75346-75646",
          "Fvb5:26595217-26595517", "Fvb7:859012-859312",
          "Fvb1:21701225-21701525", "Fvb6:6764945-6765245",
          "Fvb4:13513758-13514058", "Fvb6:4056881-4057181",
          "Fvb3:30359254-30359554", "Fvb2:16823848-16824148",
          "Fvb5:21634848-21635148", "Fvb3:32021917-32022217",
          "Fvb7:11337358-11337658", "Fvb3:18573287-18573587",
          "Fvb2:25029513-25029813", "Fvb5:21118485-21118785",
          "Fvb4:11016609-11016909", "Fvb5:20911638-20911938",
          "contig_1:104581-104881", "Fvb5:17778894-17779194",
          "Fvb7:1158888-1159188", "Fvb5:18130974-18131274",
          "Fvb5:15140965-15141265", "Fvb5:14946033-14946333",
          "Fvb4:16339650-16339950", "Fvb3:816481-816781",
          "Fvb1:872213-872513", "Fvb7:3850448-3850748",
          "Fvb5:23050184-23050484", "Fvb5:12754856-12755156",
          "Fvb4:7499268-7499568", "Fvb3:8167411-8167711",
          "Fvb6:20008066-20008366", "Fvb4:10331535-10331835",
          "Fvb1:22746967-22747267", "Fvb6:12163661-12163961",
          "Fvb6:26782987-26783287", "Fvb6:14858726-14859026",
          "Fvb4:8709683-8709983", "Fvb4:5244091-5244391",
          "Fvb4:18949928-18950228", "Fvb4:13311059-13311359",
          "Fvb3:16641099-16641399", "Fvb2:6634952-6635252",
          "Fvb4:7427386-7427686", "Fvb5:1049794-1050094",
          "Fvb5:6280365-6280665", "Fvb5:23426751-23427051",
          "Fvb5:22872620-22872920", "Fvb4:9241445-9241745",
          "Fvb4:27404261-27404561", "Fvb2:19516013-19516313",
          "Fvb1:10388162-10388462", "Fvb2:11110428-11110728",
          "Fvb2:3115082-3115382", "Fvb5:11583029-11583329",
          "Fvb5:21425739-21426039", "Fvb5:12770561-12770861",
          "Fvb4:9361725-9362025", "Fvb3:13565638-13565938",
          "Fvb4:20778945-20779245", "Fvb4:19032211-19032511",
          "Fvb3:19806458-19806758", "Fvb2:7504861-7505161",
          "Fvb2:20032777-20033077", "Fvb6:21849071-21849371",
          "Fvb1:21673320-21673620", "Fvb1:20411972-20412272",
          "Fvb4:11201122-11201422", "Fvb5:15443086-15443386",
          "Fvb7:21806781-21807081", "Fvb6:9598662-9598962",
          "Fvb4:804143-804443", "Fvb4:24743763-24744063",
          "Fvb4:13799119-13799419", "Fvb4:12108262-12108562",
          "Fvb3:27512177-27512477", "Fvb3:26887253-26887553",
          "Fvb3:22414623-22414923", "Fvb7:2800266-2800566",
          "Fvb2:11937996-11938296", "Fvb5:24818830-24819130",
          "Fvb1:15528142-15528442", "Fvb5:11889126-11889426",
          "Fvb4:30731661-30731961", "Fvb4:10668481-10668781",
          "Fvb3:24385828-24386128", "Fvb3:24349116-24349416",
          "Fvb1:12771290-12771590", "Fvb5:26523721-26524021",
          "Fvb4:30103914-30104214", "Fvb3:13818563-13818863",
          "Fvb2:6592882-6593182", "Fvb6:21895600-21895900",
          "Fvb3:22838846-22839146", "Fvb1:466086-466386",
          "Fvb4:330895-331195", "Fvb4:12959358-12959658",
          "Fvb5:19721791-19722091", "contig_1:80519-80819",
          "Fvb4:13914854-13915154", "Fvb7:9021347-9021647",
          "Fvb6:37638401-37638701", "Fvb5:18316467-18316767",
          "Fvb5:13357163-13357463", "Fvb4:16313907-16314207",
          "Fvb4:11815522-11815822", "Fvb3:9377190-9377490",
          "Fvb1:22964328-22964628", "Fvb1:20541208-20541508",
          "Fvb1:13197085-13197385", "Fvb4:7264292-7264592",
          "Fvb6:17292125-17292425", "Fvb2:5506184-5506484",
          "Fvb6:19240651-19240951", "Fvb4:18812693-18812993",
          "Fvb2:2530610-2530910", "Fvb7:13364595-13364895",
          "Fvb6:3346126-3346426", "Fvb6:23508358-23508658",
          "Fvb6:1164313-1164613", "Fvb4:8670521-8670821",
          "Fvb4:8525553-8525853", "Fvb4:19196967-19197267",
          "Fvb4:18845294-18845594", "Fvb3:23034966-23035266",
          "Fvb3:14996437-14996737", "Fvb3:10312759-10313059",
          "Fvb2:9796021-9796321", "Fvb2:15685773-15686073",
          "Fvb2:12329091-12329391", "Fvb1:9993536-9993836",
          "Fvb1:19925973-19926273", "Fvb5:17553632-17553932",
          "Fvb5:28262446-28262746", "Fvb2:26894378-26894678",
          "Fvb3:13178749-13179049", "Fvb6:15157516-15157816",
          "Fvb3:36668070-36668370", "Fvb3:24871756-24872056",
          "Fvb6:27187992-27188292", "Fvb7:2414453-2414753",
          "Fvb6:21091255-21091555", "Fvb6:20214610-20214910",
          "Fvb5:3054917-3055217", "Fvb5:24907336-24907636",
          "Fvb5:12426315-12426615", "Fvb5:1008065-1008365",
          "Fvb4:9760022-9760322", "Fvb3:8996509-8996809",
          "Fvb3:34374315-34374615", "Fvb3:21175660-21175960",
          "Fvb3:18860846-18861146", "Fvb3:18344140-18344440",
          "Fvb2:6568216-6568516", "Fvb1:23177791-23178091",
          "Fvb1:14689921-14690221", "Fvb6:35637610-35637910",
          "Fvb6:24754295-24754595", "Fvb3:8572496-8572796",
          "Fvb1:17653446-17653746", "Fvb4:19422359-19422659",
          "Fvb2:8316602-8316902", "Fvb3:23799650-23799950",
          "Fvb3:16458914-16459214", "Fvb4:21514997-21515297",
          "Fvb5:23902963-23903263", "Fvb3:18580286-18580586",
          "contig_1:12358-12658", "Fvb3:14926389-14926689",
          "Fvb2:26867747-26868047", "Fvb2:14108045-14108345",
          "Fvb7:7953725-7954025", "Fvb6:24853391-24853691",
          "Fvb6:17408016-17408316", "Fvb5:27187563-27187863",
          "Fvb5:17820979-17821279", "Fvb4:8908979-8909279",
          "Fvb4:7967382-7967682", "Fvb4:19703232-19703532",
          "Fvb3:19404990-19405290", "Fvb2:7511564-7511864",
          "Fvb2:13537088-13537388", "Fvb1:404027-404327",
          "Fvb1:20452755-20453055", "Fvb3:8776825-8777125",
          "Fvb2:4565676-4565976", "Fvb5:11211942-11212242",
          "Fvb2:8121432-8121732", "Fvb6:10891002-10891302",
          "Fvb1:23006021-23006321", "Fvb1:17853142-17853442",
          "Fvb1:17409393-17409693", "Fvb5:183358-183658",
          "Fvb6:312566-312866", "Fvb3:15003492-15003792",
          "Fvb4:19752908-19753208", "Fvb1:21928225-21928525",
          "Fvb1:4225615-4225915", "Fvb7:20195604-20195904",
          "Fvb4:19937060-19937360", "Fvb4:12416455-12416755",
          "Fvb7:2975549-2975849", "Fvb7:15104638-15104938",
          "Fvb6:6035081-6035381", "Fvb4:31099915-31100215",
          "Fvb4:20189403-20189703", "Fvb4:15498643-15498943",
          "Fvb4:14598789-14599089", "Fvb4:13569768-13570068",
          "Fvb3:463153-463453", "Fvb3:34336008-34336308",
          "Fvb3:31699418-31699718", "Fvb3:25759253-25759553",
          "Fvb3:23976786-23977086", "Fvb2:7513289-7513589",
          "Fvb2:4364422-4364722", "Fvb2:14655370-14655670",
          "Fvb2:10260118-10260418", "Fvb1:3969605-3969905",
          "Fvb4:140839-141139", "Fvb6:2738910-2739210",
          "Fvb4:8758770-8759070", "Fvb7:22450924-22451224",
          "Fvb6:32589200-32589500", "Fvb6:17304282-17304582",
          "Fvb4:23472389-23472689", "Fvb6:22514132-22514432",
          "Fvb5:1579166-1579466", "Fvb7:1614800-1615100",
          "Fvb4:202521-202821", "Fvb4:21398418-21398718",
          "Fvb6:14868932-14869232", "Fvb5:2817788-2818088",
          "Fvb5:9181745-9182045", "Fvb6:122080-122380",
          "Fvb3:3938374-3938674", "Fvb2:2335911-2336211",
          "Fvb2:19093584-19093884", "Fvb1:15729805-15730105",
          "Fvb7:20452202-20452502", "Fvb7:8708978-8709278",
          "Fvb6:37915387-37915687", "Fvb6:24774424-24774724",
          "Fvb6:21147570-21147870", "Fvb6:18346087-18346387",
          "Fvb6:10948464-10948764", "Fvb5:7532667-7532967",
          "Fvb5:23987022-23987322", "Fvb5:22603000-22603300",
          "Fvb4:6924703-6925003", "Fvb4:4190226-4190526",
          "Fvb4:23683123-23683423", "Fvb4:2366474-2366774",
          "Fvb4:20041127-20041427", "Fvb3:2815255-2815555",
          "Fvb3:19702905-19703205", "Fvb3:15630229-15630529",
          "Fvb2:8042629-8042929", "Fvb2:27208541-27208841",
          "Fvb2:13534895-13535195", "Fvb1:14252039-14252339",
          "Fvb2:22093683-22093983", "Fvb7:7232769-7233069",
          "Fvb5:11404287-11404587", "Fvb4:8474206-8474506",
          "Fvb3:22369890-22370190", "Fvb3:22312605-22312905",
          "Fvb2:6933914-6934214", "Fvb2:22673201-22673501",
          "Fvb7:821454-821754", "Fvb1:23289689-23289989",
          "Fvb2:25306274-25306574", "Fvb3:15906645-15906945",
          "Fvb3:25618078-25618378", "Fvb1:5475159-5475459",
          "Fvb5:12212158-12212458", "Fvb4:19647519-19647819",
          "Fvb1:16423639-16423939", "Fvb5:13444260-13444560",
          "Fvb4:9474257-9474557", "Fvb4:4034875-4035175",
          "Fvb6:28366815-28367115", "Fvb4:6506952-6507252",
          "Fvb2:5488299-5488599", "Fvb4:24365805-24366105",
          "Fvb7:7550686-7550986", "Fvb7:6805913-6806213",
          "Fvb7:6759770-6760070", "Fvb6:982034-982334",
          "Fvb6:28531771-28532071", "Fvb6:28490800-28491100",
          "Fvb6:13972400-13972700", "Fvb6:13730620-13730920",
          "Fvb6:13058792-13059092", "Fvb6:12963422-12963722",
          "Fvb6:11095002-11095302", "Fvb5:22393570-22393870",
          "Fvb5:21442994-21443294", "Fvb5:12167069-12167369",
          "Fvb4:8917989-8918289", "Fvb4:86766-87066", "Fvb4:3569119-3569419",
          "Fvb4:27984374-27984674", "Fvb4:22702895-22703195",
          "Fvb4:16611614-16611914", "Fvb4:13403846-13404146",
          "Fvb4:12394482-12394782", "Fvb3:8571616-8571916",
          "Fvb3:25593094-25593394", "Fvb3:19580583-19580883",
          "Fvb3:18858255-18858555", "Fvb3:18630397-18630697",
          "Fvb2:19376287-19376587", "Fvb2:16554859-16555159",
          "Fvb1:5033486-5033786", "Fvb1:3992027-3992327",
          "Fvb1:20482128-20482428", "Fvb2:7567502-7567802",
          "Fvb5:22999022-22999322", "Fvb4:9433735-9434035",
          "Fvb4:22904727-22905027", "Fvb1:12827152-12827452",
          "Fvb4:13977951-13978251", "Fvb7:11336199-11336499",
          "Fvb3:3731325-3731625", "Fvb1:16233041-16233341",
          "Fvb2:13232853-13233153", "Fvb4:12283069-12283369",
          "Fvb6:18432461-18432761", "Fvb6:19955525-19955825",
          "Fvb2:13601017-13601317", "Fvb1:907250-907550",
          "Fvb1:20060834-20061134", "Fvb5:10845730-10846030",
          "Fvb6:14441169-14441469", "Fvb3:16384139-16384439",
          "Fvb1:18107200-18107500", "Fvb6:33977220-33977520",
          "Fvb4:12415220-12415520", "Fvb1:16662377-16662677",
          "Fvb2:11696397-11696697", "Fvb1:14272079-14272379",
          "Fvb7:15566828-15567128", "Fvb4:23961474-23961774",
          "Fvb3:14232852-14233152", "Fvb7:15708299-15708599",
          "Fvb6:9880931-9881231", "Fvb6:23484393-23484693",
          "Fvb6:21660881-21661181", "Fvb6:16656524-16656824",
          "Fvb5:15013072-15013372", "Fvb4:8913033-8913333",
          "Fvb4:31646798-31647098", "Fvb4:25835108-25835408",
          "Fvb4:21107189-21107489", "Fvb4:19854638-19854938",
          "Fvb4:18937900-18938200", "Fvb4:15879376-15879676",
          "Fvb4:13845745-13846045", "Fvb4:12702438-12702738",
          "Fvb3:29461407-29461707", "Fvb3:29063552-29063852",
          "Fvb3:15669267-15669567", "Fvb3:14638465-14638765",
          "Fvb2:6176019-6176319", "Fvb2:3739579-3739879",
          "Fvb2:1749625-1749925", "Fvb1:23508084-23508384",
          "Fvb1:22285383-22285683", "Fvb6:5899215-5899515",
          "Fvb5:7510433-7510733", "Fvb4:8398469-8398769",
          "Fvb3:16382333-16382633", "Fvb3:28133766-28134066",
          "Fvb4:12630816-12631116", "Fvb4:12718296-12718596",
          "Fvb3:25935899-25936199", "Fvb1:12934092-12934392",
          "Fvb4:29866387-29866687", "Fvb5:7476284-7476584",
          "Fvb2:10825114-10825414", "Fvb6:18355169-18355469",
          "Fvb5:15459957-15460257", "Fvb4:10958504-10958804",
          "Fvb3:30736759-30737059", "Fvb3:26580641-26580941",
          "Fvb2:3943773-3944073", "Fvb5:17220423-17220723",
          "Fvb4:12768487-12768787", "Fvb7:12154482-12154782",
          "Fvb6:8772725-8773025", "Fvb6:26580975-26581275",
          "Fvb6:26424195-26424495", "Fvb6:14819337-14819637",
          "Fvb5:22589929-22590229", "Fvb5:21352577-21352877",
          "Fvb5:17499599-17499899", "Fvb5:14632882-14633182",
          "Fvb4:4451168-4451468", "Fvb4:24519680-24519980",
          "Fvb4:19829067-19829367", "Fvb4:18281562-18281862",
          "Fvb4:15762254-15762554", "Fvb4:14664832-14665132",
          "Fvb4:14659444-14659744", "Fvb4:13642103-13642403",
          "Fvb3:7756552-7756852", "Fvb3:4610062-4610362",
          "Fvb3:35333563-35333863", "Fvb3:2832924-2833224",
          "Fvb3:27513001-27513301", "Fvb3:26185681-26185981",
          "Fvb3:21503929-21504229", "Fvb3:19415453-19415753",
          "Fvb3:18924378-18924678", "Fvb3:18254628-18254928",
          "Fvb3:16314594-16314894", "Fvb3:12801369-12801669",
          "Fvb2:1906593-1906893", "Fvb2:18084128-18084428",
          "Fvb2:13557593-13557893", "Fvb1:23180866-23181166",
          "Fvb1:22622739-22623039", "Fvb1:21110965-21111265",
          "Fvb4:19349469-19349769", "Fvb3:26421963-26422263",
          "Fvb4:9504077-9504377", "Fvb1:22492360-22492660",
          "Fvb1:19701665-19701965", "Fvb1:9876230-9876530",
          "Fvb5:21342516-21342816", "Fvb1:2508728-2509028",
          "Fvb5:8143164-8143464", "Fvb3:3947309-3947609",
          "Fvb3:37547700-37548000", "Fvb3:32563136-32563436",
          "Fvb4:25479178-25479478", "Fvb3:38306622-38306922",
          "Fvb4:16630203-16630503", "Fvb2:6800606-6800906",
          "Fvb3:5146790-5147090", "Fvb3:1179497-1179797",
          "Fvb1:19612139-19612439", "Fvb5:17451523-17451823",
          "Fvb3:25550979-25551279", "Fvb6:38804011-38804311",
          "Fvb6:23500109-23500409", "Fvb5:28760116-28760416",
          "Fvb5:26166468-26166768", "Fvb5:16759765-16760065",
          "Fvb4:639158-639458", "Fvb3:19654412-19654712",
          "Fvb2:9110307-9110607", "Fvb1:22486489-22486789",
          "Fvb1:19666146-19666446", "Fvb1:13962460-13962760",
          "Fvb7:19313859-19314159", "Fvb7:13871084-13871384",
          "Fvb6:32516481-32516781", "Fvb6:25278080-25278380",
          "Fvb6:22242302-22242602", "Fvb6:11023067-11023367",
          "Fvb5:8186895-8187195", "Fvb5:22443902-22444202",
          "Fvb5:22159867-22160167", "Fvb5:12664020-12664320",
          "Fvb4:7981085-7981385", "Fvb4:4772818-4773118",
          "Fvb4:21266226-21266526", "Fvb4:10437959-10438259",
          "Fvb3:8347037-8347337", "Fvb3:33147821-33148121",
          "Fvb3:29175230-29175530", "Fvb3:23412958-23413258",
          "Fvb3:18921077-18921377", "Fvb2:8545111-8545411",
          "Fvb2:6819877-6820177", "Fvb2:5758848-5759148",
          "Fvb2:27273399-27273699", "Fvb2:26777266-26777566",
          "Fvb2:23264373-23264673", "Fvb2:18138377-18138677",
          "Fvb1:3376414-3376714", "Fvb1:2759279-2759579",
          "Fvb1:19160090-19160390", "Fvb1:16113704-16114004",
          "Fvb5:20683998-20684298", "Fvb3:30985863-30986163",
          "Fvb3:17664674-17664974", "Fvb3:10878875-10879175",
          "Fvb6:35250849-35251149", "Fvb7:4099198-4099498",
          "Fvb3:25788867-25789167", "Fvb2:25648792-25649092",
          "Fvb1:4816871-4817171", "Fvb6:1833454-1833754",
          "Fvb6:24607284-24607584", "Fvb4:19376768-19377068",
          "Fvb3:12832896-12833196", "Fvb6:23712214-23712514",
          "Fvb4:31208614-31208914", "Fvb4:19733109-19733409",
          "Fvb4:12606038-12606338", "Fvb2:7016352-7016652",
          "Fvb5:11834059-11834359", "Fvb3:30044094-30044394",
          "Fvb6:19914150-19914450", "Fvb2:23582573-23582873",
          "Fvb7:3136455-3136755", "Fvb5:5662186-5662486",
          "Fvb5:18708452-18708752", "Fvb5:17966985-17967285",
          "Fvb3:22270353-22270653", "Fvb3:19662526-19662826",
          "Fvb3:17465876-17466176", "Fvb2:13521978-13522278",
          "Fvb1:4865847-4866147", "Fvb6:26261482-26261782",
          "Fvb6:4262247-4262547", "Fvb4:10111556-10111856",
          "Fvb3:23301128-23301428", "Fvb2:7277981-7278281",
          "Fvb1:6718515-6718815", "Fvb5:11958056-11958356",
          "Fvb7:8539922-8540222", "Fvb7:5218199-5218499",
          "Fvb7:3957523-3957823", "Fvb7:20987719-20988019",
          "Fvb6:32984353-32984653", "Fvb6:22948695-22948995",
          "Fvb6:17955362-17955662", "Fvb6:17462126-17462426",
          "Fvb6:12777795-12778095", "Fvb6:12001744-12002044",
          "Fvb5:26801392-26801692", "Fvb5:26314672-26314972",
          "Fvb4:8922265-8922565", "Fvb4:8468419-8468719",
          "Fvb4:27317192-27317492", "Fvb4:20460023-20460323",
          "Fvb4:13773273-13773573", "Fvb3:25297924-25298224",
          "Fvb3:25083390-25083690", "Fvb3:22133022-22133322",
          "Fvb2:28649412-28649712", "Fvb2:21333808-21334108",
          "Fvb2:15711398-15711698", "Fvb2:15680028-15680328",
          "Fvb1:8978316-8978616", "Fvb1:20505330-20505630",
          "Fvb1:19975122-19975422", "Fvb1:16179827-16180127",
          "Fvb1:15380045-15380345", "Fvb1:10329841-10330141",
          "Fvb6:18537301-18537601", "Fvb2:19000812-19001112",
          "Fvb6:13055033-13055333", "Fvb4:10229107-10229407",
          "Fvb2:25891779-25892079", "Fvb6:688306-688606",
          "Fvb6:19298163-19298463", "Fvb5:20566594-20566894",
          "Fvb4:32010006-32010306", "Fvb7:4891426-4891726",
          "Fvb6:3772236-3772536", "Fvb6:30305097-30305397",
          "Fvb6:18637775-18638075", "Fvb5:25337927-25338227",
          "Fvb4:9593937-9594237", "Fvb4:32209210-32209510",
          "Fvb4:1717485-1717785", "Fvb4:13431740-13432040",
          "Fvb4:11339031-11339331", "Fvb3:27013006-27013306",
          "Fvb3:15889478-15889778", "Fvb1:4795107-4795407",
          "Fvb1:23408501-23408801", "Fvb5:2325573-2325873",
          "Fvb5:7917498-7917798", "Fvb3:29331289-29331589",
          "Fvb2:23629063-23629363", "Fvb1:23501737-23502037",
          "Fvb7:19203136-19203436", "Fvb5:26221197-26221497",
          "Fvb7:833329-833629", "Fvb7:4190929-4191229",
          "Fvb7:3842811-3843111", "Fvb7:2990157-2990457",
          "Fvb6:26185230-26185530", "Fvb6:22415760-22416060",
          "Fvb6:17417373-17417673", "Fvb6:17297239-17297539",
          "Fvb6:16809272-16809572", "Fvb6:15919634-15919934",
          "Fvb6:1151150-1151450", "Fvb5:874777-875077",
          "Fvb5:25682817-25683117", "Fvb5:22674437-22674737",
          "Fvb5:21563388-21563688", "Fvb5:19446726-19447026",
          "Fvb4:30700766-30701066", "Fvb4:30462768-30463068",
          "Fvb4:23653131-23653431", "Fvb4:20027181-20027481",
          "Fvb4:18017888-18018188", "Fvb4:17331224-17331524",
          "Fvb4:12889240-12889540", "Fvb4:11452859-11453159",
          "Fvb4:11350026-11350326", "Fvb4:11344568-11344868",
          "Fvb4:10280053-10280353", "Fvb3:494799-495099",
          "Fvb3:35522584-35522884", "Fvb3:31102260-31102560",
          "Fvb3:27250311-27250611", "Fvb3:25888409-25888709",
          "Fvb3:24572491-24572791", "Fvb3:19554411-19554711",
          "Fvb2:4690776-4691076", "Fvb2:19783899-19784199",
          "Fvb1:2612725-2613025", "Fvb1:22224999-22225299",
          "Fvb6:3557404-3557704", "Fvb4:15106670-15106970",
          "Fvb4:23507791-23508091", "Fvb6:38970922-38971222",
          "Fvb2:24701134-24701434", "Fvb2:23520439-23520739",
          "Fvb6:16918816-16919116", "Fvb7:4108553-4108853",
          "Fvb6:19413147-19413447", "Fvb3:26083073-26083373",
          "Fvb1:4408755-4409055", "Fvb4:18051344-18051644",
          "Fvb1:12052879-12053179", "Fvb6:36321880-36322180",
          "Fvb5:14985964-14986264", "Fvb2:2574082-2574382",
          "Fvb7:1105025-1105325", "Fvb7:7650336-7650636",
          "Fvb7:2785558-2785858", "Fvb5:646593-646893",
          "Fvb4:19244314-19244614", "Fvb2:13529306-13529606",
          "Fvb6:969274-969574", "Fvb6:17194300-17194600",
          "Fvb5:16530787-16531087", "Fvb4:13189203-13189503",
          "Fvb1:8698085-8698385", "Fvb1:6065083-6065383",
          "Fvb1:12384253-12384553", "Fvb3:2443496-2443796",
          "Fvb3:24090533-24090833", "Fvb7:8541476-8541776",
          "Fvb6:8902452-8902752", "Fvb6:28493220-28493520",
          "Fvb6:24865923-24866223", "Fvb5:16333819-16334119",
          "Fvb4:9757000-9757300", "Fvb1:8024033-8024333",
          "Fvb1:5079467-5079767", "Fvb4:22911331-22911631",
          "Fvb1:6247377-6247677", "Fvb6:38886306-38886606",
          "Fvb7:19639186-19639486", "Fvb7:17873634-17873934",
          "Fvb7:16968001-16968301", "Fvb6:5416135-5416435",
          "Fvb6:38889208-38889508", "Fvb6:24304417-24304717",
          "Fvb6:23006012-23006312", "Fvb6:20680598-20680898",
          "Fvb6:17696146-17696446", "Fvb6:12558901-12559201",
          "Fvb5:4946607-4946907", "Fvb5:28856448-28856748",
          "Fvb5:23363615-23363915", "Fvb5:22737298-22737598",
          "Fvb5:22567790-22568090", "Fvb5:20894620-20894920",
          "Fvb5:16402240-16402540", "Fvb4:9147492-9147792",
          "Fvb4:30532977-30533277", "Fvb4:29020687-29020987",
          "Fvb4:24641823-24642123", "Fvb4:19316652-19316952",
          "Fvb4:15682381-15682681", "Fvb4:11862877-11863177",
          "Fvb4:11274105-11274405", "Fvb4:10272389-10272689",
          "Fvb3:5155718-5156018", "Fvb3:33439556-33439856",
          "Fvb3:29102223-29102523", "Fvb3:19435671-19435971",
          "Fvb2:9455501-9455801", "Fvb2:7538506-7538806",
          "Fvb2:671279-671579", "Fvb2:4811462-4811762", "Fvb1:816919-817219",
          "Fvb1:21244755-21245055", "Fvb1:15025732-15026032",
          "Fvb1:12191629-12191929", "Fvb2:787817-788117",
          "Fvb5:28750313-28750613", "Fvb4:9099602-9099902",
          "Fvb3:7583298-7583598", "Fvb7:6887237-6887537",
          "Fvb5:20211660-20211960", "Fvb2:1587247-1587547",
          "Fvb1:15132232-15132532", "Fvb4:3168901-3169201",
          "Fvb3:7639198-7639498", "Fvb3:25371448-25371748",
          "Fvb3:19708081-19708381", "Fvb3:26494943-26495243",
          "Fvb1:17783003-17783303", "Fvb7:17836145-17836445",
          "Fvb5:10785490-10785790", "Fvb3:27360226-27360526",
          "Fvb2:28069986-28070286", "Fvb3:33233303-33233603",
          "Fvb6:25091674-25091974", "Fvb4:13108321-13108621",
          "Fvb2:76342-76642", "Fvb1:10990208-10990508",
          "Fvb4:8600927-8601227", "Fvb5:4895894-4896194",
          "Fvb4:11729078-11729378", "Fvb6:4526408-4526708",
          "Fvb6:32881458-32881758", "Fvb4:21713919-21714219",
          "Fvb1:23644488-23644788", "Fvb1:21525000-21525300",
          "Fvb7:15958253-15958553", "Fvb7:11596198-11596498",
          "Fvb7:3244030-3244330", "Fvb7:22130137-22130437",
          "Fvb7:11334254-11334554", "Fvb6:7068905-7069205",
          "Fvb6:35108453-35108753", "Fvb6:2064161-2064461",
          "Fvb6:13435153-13435453", "Fvb5:2541502-2541802",
          "Fvb5:16663834-16664134", "Fvb5:16216879-16217179",
          "Fvb4:9754791-9755091", "Fvb4:7262384-7262684",
          "Fvb4:32412877-32413177", "Fvb4:29400248-29400548",
          "Fvb4:28823779-28824079", "Fvb4:23502521-23502821",
          "Fvb4:20169864-20170164", "Fvb4:14026031-14026331",
          "Fvb4:13658153-13658453", "Fvb4:13212123-13212423",
          "Fvb3:30805821-30806121", "Fvb3:26023398-26023698",
          "Fvb3:25948276-25948576", "Fvb3:19470453-19470753",
          "Fvb2:5809150-5809450", "Fvb2:18331471-18331771",
          "Fvb2:12744590-12744890", "Fvb2:1147559-1147859",
          "Fvb1:23306764-23307064", "Fvb1:23246465-23246765",
          "Fvb1:22773874-22774174", "Fvb1:22461889-22462189",
          "Fvb1:19501773-19502073", "Fvb1:17290120-17290420",
          "Fvb2:23793264-23793564", "Fvb6:9411197-9411497",
          "Fvb5:16690384-16690684", "Fvb3:4725657-4725957",
          "Fvb3:2956351-2956651", "Fvb3:34418056-34418356",
          "Fvb4:4172897-4173197", "Fvb4:13437066-13437366",
          "Fvb4:12886004-12886304", "Fvb1:15992703-15993003",
          "Fvb6:38530644-38530944", "Fvb5:15938578-15938878",
          "Fvb7:17651622-17651922", "Fvb5:22146807-22147107",
          "Fvb4:12711935-12712235", "Fvb5:12627321-12627621",
          "Fvb3:15396972-15397272", "Fvb6:34289819-34290119",
          "Fvb6:23480247-23480547", "Fvb6:30956155-30956455",
          "Fvb5:17756666-17756966", "Fvb1:4687614-4687914",
          "Fvb5:7415444-7415744", "Fvb4:18467938-18468238",
          "Fvb3:22052524-22052824", "Fvb4:19848465-19848765",
          "Fvb5:1925538-1925838", "Fvb3:3069785-3070085",
          "Fvb3:29326056-29326356", "Fvb1:6085565-6085865",
          "Fvb6:21488143-21488443", "Fvb5:23088222-23088522",
          "Fvb7:14555333-14555633", "Fvb6:13029261-13029561",
          "Fvb3:25976071-25976371", "Fvb3:19357375-19357675",
          "Fvb3:17895636-17895936", "Fvb3:16719947-16720247",
          "Fvb1:22553246-22553546", "Fvb7:14240343-14240643",
          "Fvb4:13820085-13820385", "Fvb7:3476122-3476422",
          "Fvb7:22407001-22407301", "Fvb6:5727761-5728061",
          "Fvb6:302555-302855", "Fvb6:2763536-2763836",
          "Fvb6:22588471-22588771", "Fvb6:12787467-12787767",
          "Fvb6:12234334-12234634", "Fvb5:534584-534884",
          "Fvb5:22301111-22301411", "Fvb5:14990484-14990784",
          "Fvb4:9730300-9730600", "Fvb4:5780553-5780853",
          "Fvb4:17888569-17888869", "Fvb4:16847495-16847795",
          "Fvb4:13891208-13891508", "Fvb4:12692684-12692984",
          "Fvb4:10039577-10039877", "Fvb3:38067115-38067415",
          "Fvb3:35669722-35670022", "Fvb3:30663777-30664077",
          "Fvb3:29477178-29477478", "Fvb3:26137787-26138087",
          "Fvb3:2254245-2254545", "Fvb3:19324757-19325057",
          "Fvb3:1484188-1484488", "Fvb3:14452919-14453219",
          "Fvb2:28480325-28480625", "Fvb2:256379-256679",
          "Fvb2:21229996-21230296", "Fvb2:18455031-18455331",
          "Fvb1:7265777-7266077", "Fvb1:22910254-22910554",
          "Fvb1:16859867-16860167", "Fvb5:15586559-15586859",
          "Fvb2:8469722-8470022", "Fvb2:21625378-21625678",
          "Fvb7:10953118-10953418", "Fvb6:22319214-22319514",
          "Fvb4:270735-271035", "Fvb4:9772236-9772536",
          "Fvb3:25399375-25399675", "Fvb4:25603327-25603627",
          "Fvb2:18594001-18594301", "Fvb6:6318760-6319060",
          "Fvb3:31397372-31397672", "Fvb4:17548149-17548449",
          "Fvb3:32207641-32207941", "Fvb4:7122620-7122920",
          "Fvb4:12106250-12106550", "Fvb3:26007275-26007575",
          "Fvb1:13168285-13168585", "Fvb4:18818494-18818794",
          "Fvb5:4700388-4700688", "Fvb3:2584242-2584542",
          "Fvb1:20838879-20839179", "Fvb6:15614034-15614334",
          "Fvb6:21954867-21955167", "Fvb4:11969003-11969303",
          "Fvb2:183908-184208", "Fvb2:11422321-11422621", "Fvb4:95414-95714",
          "Fvb4:7554038-7554338", "Fvb1:22549740-22550040",
          "Fvb7:14564057-14564357", "Fvb5:22716734-22717034",
          "Fvb4:21915813-21916113", "Fvb4:14036435-14036735",
          "Fvb4:13268352-13268652", "Fvb4:12284204-12284504",
          "Fvb4:10629921-10630221", "Fvb3:14155223-14155523",
          "Fvb2:21914544-21914844", "Fvb3:26335617-26335917",
          "Fvb3:19548831-19549131", "Fvb1:19161273-19161573",
          "Fvb5:7147127-7147427", "Fvb4:22923786-22924086",
          "Fvb3:24059344-24059644", "Fvb5:26532070-26532370",
          "Fvb1:21863334-21863634", "Fvb7:947655-947955",
          "Fvb7:8027978-8028278", "Fvb7:6293261-6293561",
          "Fvb7:19894203-19894503", "Fvb6:5672149-5672449",
          "Fvb6:26379087-26379387", "Fvb6:25355924-25356224",
          "Fvb6:12958357-12958657", "Fvb5:15519487-15519787",
          "Fvb4:8834901-8835201", "Fvb4:8335756-8336056",
          "Fvb4:29884860-29885160", "Fvb4:27285012-27285312",
          "Fvb4:23504056-23504356", "Fvb4:17709648-17709948",
          "Fvb4:13678098-13678398", "Fvb4:13024885-13025185",
          "Fvb4:10691058-10691358", "Fvb3:7754995-7755295",
          "Fvb3:33007953-33008253", "Fvb3:32028869-32029169",
          "Fvb3:31672614-31672914", "Fvb3:30734698-30734998",
          "Fvb3:3003286-3003586", "Fvb3:23534383-23534683",
          "Fvb3:17325422-17325722", "Fvb3:16161371-16161671",
          "Fvb3:12580963-12581263", "Fvb2:9780121-9780421",
          "Fvb2:27336634-27336934", "Fvb2:1897976-1898276",
          "Fvb2:15768080-15768380", "Fvb1:19608558-19608858",
          "Fvb4:11886054-11886354", "Fvb3:2602901-2603201",
          "Fvb2:8819937-8820237", "Fvb3:23104776-23105076",
          "Fvb3:22679487-22679787", "Fvb7:24062419-24062719",
          "Fvb7:3305585-3305885", "Fvb5:18985543-18985843",
          "Fvb3:26926381-26926681", "Fvb3:22970318-22970618",
          "Fvb1:21897877-21898177", "Fvb1:15521190-15521490",
          "Fvb4:12579537-12579837", "Fvb2:13330711-13331011",
          "Fvb7:5500354-5500654", "Fvb4:22824000-22824300",
          "Fvb5:15883122-15883422", "Fvb6:1102929-1103229",
          "Fvb5:16258863-16259163", "Fvb4:10898995-10899295",
          "Fvb3:27141446-27141746", "Fvb3:15767102-15767402",
          "Fvb1:23405363-23405663", "Fvb5:21236963-21237263",
          "Fvb4:10433900-10434200", "Fvb4:16363526-16363826",
          "Fvb6:22072076-22072376", "Fvb5:7777839-7778139",
          "Fvb4:9303892-9304192", "Fvb4:16066060-16066360",
          "Fvb4:116719-117019", "Fvb3:7827840-7828140",
          "Fvb6:31568733-31569033", "Fvb4:22204972-22205272",
          "Fvb4:11858878-11859178", "Fvb2:21278698-21278998",
          "Fvb1:23210919-23211219", "Fvb4:8690953-8691253",
          "Fvb4:20021602-20021902", "Fvb4:7715807-7716107",
          "Fvb7:9148692-9148992", "Fvb7:18950117-18950417",
          "Fvb7:16363487-16363787", "Fvb6:16594815-16595115",
          "Fvb5:4496308-4496608", "Fvb5:13744877-13745177",
          "Fvb4:28043661-28043961", "Fvb4:13462699-13462999",
          "Fvb4:12404676-12404976", "Fvb3:1309936-1310236",
          "Fvb4:32364914-32365214", "Fvb7:3944089-3944389",
          "Fvb7:17889423-17889723", "Fvb7:13540890-13541190",
          "Fvb7:10276184-10276484", "Fvb6:30336463-30336763",
          "Fvb6:24802470-24802770", "Fvb6:11936916-11937216",
          "Fvb5:21532456-21532756", "Fvb5:18577745-18578045",
          "Fvb5:1128458-1128758", "Fvb4:8713514-8713814",
          "Fvb4:5182107-5182407", "Fvb4:4124139-4124439",
          "Fvb4:32750083-32750383", "Fvb4:32080410-32080710",
          "Fvb4:26563039-26563339", "Fvb4:24272257-24272557",
          "Fvb4:23055813-23056113", "Fvb4:18017108-18017408",
          "Fvb4:16539081-16539381", "Fvb4:14173519-14173819",
          "Fvb4:14016652-14016952", "Fvb4:13841564-13841864",
          "Fvb4:13829145-13829445", "Fvb4:13664212-13664512",
          "Fvb4:13468282-13468582", "Fvb4:12185458-12185758",
          "Fvb4:11913326-11913626", "Fvb3:34404405-34404705",
          "Fvb3:28978249-28978549", "Fvb3:26665351-26665651",
          "Fvb3:24969673-24969973", "Fvb3:23115455-23115755",
          "Fvb3:23004760-23005060", "Fvb3:20081123-20081423",
          "Fvb3:11909574-11909874", "Fvb2:9161547-9161847",
          "Fvb2:16312402-16312702", "Fvb2:14544273-14544573",
          "Fvb2:14064632-14064932", "Fvb1:4366858-4367158",
          "Fvb1:20636807-20637107", "Fvb1:15944560-15944860",
          "Fvb1:15518317-15518617", "Fvb6:35642760-35643060",
          "Fvb3:5434086-5434386", "Fvb5:2138900-2139200",
          "Fvb4:8954641-8954941", "Fvb4:10384181-10384481",
          "Fvb3:7590904-7591204", "Fvb1:20825567-20825867",
          "Fvb2:29333498-29333798", "Fvb4:30330447-30330747",
          "Fvb4:11610938-11611238", "Fvb3:9853330-9853630",
          "Fvb3:31593584-31593884", "Fvb1:3854242-3854542",
          "Fvb7:3034401-3034701", "Fvb6:30728901-30729201",
          "Fvb5:14908572-14908872", "Fvb3:34241080-34241380",
          "Fvb2:10953546-10953846", "Fvb1:869291-869591",
          "Fvb1:13934290-13934590", "Fvb6:31555960-31556260",
          "Fvb5:29006600-29006900", "Fvb4:12902804-12903104",
          "Fvb4:25071008-25071308", "Fvb1:14593324-14593624",
          "Fvb7:16171885-16172185", "Fvb6:28791284-28791584",
          "Fvb6:16488624-16488924", "Fvb5:18206485-18206785",
          "Fvb4:8696855-8697155", "Fvb4:12638231-12638531",
          "Fvb4:10909948-10910248", "Fvb3:25862423-25862723",
          "Fvb3:24105132-24105432", "Fvb1:17659629-17659929",
          "Fvb2:114780-115080", "Fvb4:9595139-9595439",
          "Fvb7:18833265-18833565", "Fvb4:13199141-13199441",
          "Fvb4:11526456-11526756", "Fvb3:13572983-13573283",
          "Fvb2:9086827-9087127", "Fvb3:13909214-13909514",
          "Fvb5:6007134-6007434", "Fvb4:12056203-12056503",
          "Fvb3:28765591-28765891", "Fvb2:18463446-18463746",
          "Fvb3:21784044-21784344", "Fvb2:1347499-1347799",
          "Fvb4:13483419-13483719", "Fvb7:2468683-2468983",
          "Fvb7:21138391-21138691", "Fvb7:16942738-16943038",
          "Fvb7:16816340-16816640", "Fvb7:10138309-10138609",
          "Fvb6:7938112-7938412", "Fvb6:6794057-6794357",
          "Fvb6:6009095-6009395", "Fvb6:39008516-39008816",
          "Fvb6:33830996-33831296", "Fvb6:31506325-31506625",
          "Fvb6:31010950-31011250", "Fvb6:29908976-29909276",
          "Fvb6:26257115-26257415", "Fvb6:23926059-23926359",
          "Fvb6:10197452-10197752", "Fvb5:29380284-29380584",
          "Fvb5:18867895-18868195", "Fvb5:15236431-15236731",
          "Fvb4:9192577-9192877", "Fvb4:8673754-8674054",
          "Fvb4:8614669-8614969", "Fvb4:45599-45899",
          "Fvb4:27732690-27732990", "Fvb4:14443723-14444023",
          "Fvb4:13594977-13595277", "Fvb4:13276921-13277221",
          "Fvb4:12434491-12434791", "Fvb4:12385596-12385896",
          "Fvb4:12275923-12276223", "Fvb4:11595347-11595647",
          "Fvb4:10859613-10859913", "Fvb3:6734963-6735263",
          "Fvb3:34516873-34517173", "Fvb3:30778739-30779039",
          "Fvb3:28001989-28002289", "Fvb3:26588081-26588381",
          "Fvb3:25444494-25444794", "Fvb3:24857016-24857316",
          "Fvb3:24429551-24429851", "Fvb3:24360167-24360467",
          "Fvb3:24318699-24318999", "Fvb3:22700027-22700327",
          "Fvb2:22469565-22469865", "Fvb2:22240548-22240848",
          "Fvb2:16196159-16196459", "Fvb2:14738277-14738577",
          "Fvb1:8306024-8306324", "Fvb1:23538789-23539089",
          "Fvb1:22934431-22934731", "Fvb1:20173394-20173694",
          "Fvb1:19265597-19265897", "Fvb1:15125190-15125490",
          "Fvb4:28241403-28241703", "Fvb3:8291585-8291885",
          "Fvb6:23705603-23705903", "Fvb7:22335935-22336235",
          "Fvb4:9190691-9190991", "Fvb1:12185174-12185474",
          "Fvb4:7624664-7624964", "Fvb4:33439145-33439445",
          "Fvb2:5277542-5277842", "Fvb4:6027140-6027440",
          "Fvb7:2343475-2343775", "Fvb7:13718438-13718738",
          "Fvb7:17404829-17405129", "Fvb6:9225776-9226076",
          "Fvb4:22370413-22370713", "Fvb4:13564235-13564535",
          "Fvb3:20282640-20282940", "Fvb2:19395208-19395508",
          "Fvb2:21958059-21958359", "Fvb1:16829112-16829412",
          "Fvb4:21334656-21334956", "contig_1:3057-3357",
          "Fvb3:35644868-35645168", "Fvb4:12682025-12682325",
          "Fvb6:13939368-13939668", "Fvb4:6151458-6151758",
          "Fvb5:15083487-15083787", "Fvb4:10174015-10174315",
          "Fvb3:32512340-32512640", "Fvb3:24962414-24962714",
          "Fvb1:23058197-23058497", "Fvb1:21265476-21265776",
          "Fvb7:19415475-19415775", "Fvb6:16089727-16090027",
          "Fvb3:31437958-31438258", "Fvb4:13855407-13855707",
          "Fvb2:26870189-26870489", "Fvb3:5777363-5777663",
          "Fvb3:12881456-12881756", "Fvb4:20073709-20074009",
          "Fvb4:1894442-1894742", "Fvb3:27953327-27953627",
          "Fvb3:21488560-21488860", "Fvb2:28680870-28681170",
          "Fvb7:12174179-12174479", "Fvb5:25301087-25301387",
          "Fvb5:14212256-14212556", "Fvb4:9734685-9734985",
          "Fvb3:33816363-33816663", "Fvb1:17930758-17931058",
          "Fvb7:9261389-9261689", "Fvb7:667276-667576",
          "Fvb7:5925799-5926099", "Fvb7:5917666-5917966",
          "Fvb7:5499089-5499389", "Fvb7:5248542-5248842",
          "Fvb7:3098405-3098705", "Fvb7:22199246-22199546",
          "Fvb7:21386464-21386764", "Fvb6:8785273-8785573",
          "Fvb6:68723-69023", "Fvb6:3621405-3621705",
          "Fvb6:32684894-32685194", "Fvb6:31869664-31869964",
          "Fvb6:31032949-31033249", "Fvb6:26698407-26698707",
          "Fvb6:25333996-25334296", "Fvb6:16971730-16972030",
          "Fvb6:13186439-13186739", "Fvb5:9757410-9757710",
          "Fvb5:7107203-7107503", "Fvb5:6802947-6803247",
          "Fvb5:583008-583308", "Fvb5:27803183-27803483",
          "Fvb5:2623143-2623443", "Fvb5:17184034-17184334",
          "Fvb5:15717202-15717502", "Fvb5:12659843-12660143",
          "Fvb5:11953563-11953863", "Fvb5:1073011-1073311",
          "Fvb4:8918730-8919030", "Fvb4:5575916-5576216",
          "Fvb4:32850443-32850743", "Fvb4:31351893-31352193",
          "Fvb4:30851657-30851957", "Fvb4:30321171-30321471",
          "Fvb4:28941789-28942089", "Fvb4:19593611-19593911",
          "Fvb4:19158672-19158972", "Fvb4:14137602-14137902",
          "Fvb4:13484292-13484592", "Fvb4:10714405-10714705",
          "Fvb4:10046744-10047044", "Fvb4:10003963-10004263",
          "Fvb3:9431290-9431590", "Fvb3:5302189-5302489",
          "Fvb3:27916727-27917027", "Fvb3:23606300-23606600",
          "Fvb3:13361340-13361640", "Fvb2:3941161-3941461",
          "Fvb2:3202024-3202324", "Fvb2:2091379-2091679",
          "Fvb1:5725705-5726005", "Fvb1:4637991-4638291",
          "Fvb1:23415919-23416219", "Fvb1:21704130-21704430",
          "Fvb1:1039846-1040146", "Fvb1:10309763-10310063",
          "Fvb6:21163740-21164040", "Fvb7:5083183-5083483",
          "Fvb5:7461267-7461567", "Fvb7:4149552-4149852",
          "Fvb2:6988545-6988845", "Fvb7:11347333-11347633",
          "Fvb4:7790189-7790489", "Fvb5:6281849-6282149",
          "Fvb6:14192354-14192654", "Fvb4:33575039-33575339",
          "Fvb3:16209532-16209832", "Fvb2:25261502-25261802",
          "Fvb4:33327061-33327361", "Fvb4:11692090-11692390",
          "Fvb5:725689-725989", "Fvb4:7878884-7879184",
          "Fvb4:31153795-31154095", "Fvb2:22098205-22098505",
          "Fvb1:23046560-23046860", "Fvb1:22445398-22445698",
          "Fvb1:13063500-13063800", "Fvb5:15889188-15889488",
          "Fvb3:23498523-23498823", "Fvb6:3625361-3625661",
          "Fvb4:13121912-13122212", "Fvb3:25341359-25341659",
          "Fvb3:14444255-14444555", "Fvb1:19582260-19582560",
          "Fvb1:10429606-10429906", "Fvb3:36719755-36720055",
          "Fvb3:25755398-25755698", "Fvb2:25890625-25890925",
          "Fvb2:1350969-1351269", "Fvb6:7742500-7742800",
          "Fvb6:29802669-29802969", "Fvb6:25520936-25521236",
          "Fvb5:5369163-5369463", "Fvb5:20714478-20714778",
          "Fvb3:26785604-26785904", "Fvb2:16810474-16810774",
          "Fvb2:1290023-1290323", "Fvb1:21652941-21653241",
          "Fvb4:19372520-19372820", "Fvb5:4340957-4341257",
          "Fvb4:27579758-27580058", "Fvb7:9439029-9439329",
          "Fvb6:9445118-9445418", "Fvb6:17325020-17325320",
          "Fvb4:8728405-8728705", "Fvb4:19995623-19995923",
          "Fvb4:12299002-12299302", "Fvb4:11866344-11866644",
          "Fvb3:20735269-20735569", "Fvb3:1623746-1624046",
          "Fvb3:10983001-10983301", "Fvb2:18208270-18208570",
          "Fvb5:15330118-15330418", "Fvb5:28722215-28722515",
          "Fvb7:16951866-16952166", "Fvb6:9916514-9916814",
          "Fvb3:11712564-11712864", "Fvb6:4037002-4037302",
          "Fvb5:4673173-4673473", "Fvb4:5984685-5984985",
          "Fvb4:18567064-18567364", "Fvb4:10694187-10694487",
          "Fvb3:3757523-3757823", "Fvb1:14445724-14446024",
          "Fvb5:456449-456749", "Fvb7:9234488-9234788",
          "Fvb7:5047939-5048239", "Fvb6:29523605-29523905",
          "Fvb6:27403232-27403532", "Fvb6:21883378-21883678",
          "Fvb6:21463361-21463661", "Fvb6:19334605-19334905",
          "Fvb6:14642090-14642390", "Fvb6:1357635-1357935",
          "Fvb6:11710198-11710498", "Fvb6:10465186-10465486",
          "Fvb5:9397505-9397805", "Fvb5:8758820-8759120",
          "Fvb5:3692442-3692742", "Fvb5:22955123-22955423",
          "Fvb5:18961020-18961320", "Fvb4:9214423-9214723",
          "Fvb4:8892098-8892398", "Fvb4:8736901-8737201",
          "Fvb4:4924803-4925103", "Fvb4:3103743-3104043",
          "Fvb4:26403413-26403713", "Fvb4:21981110-21981410",
          "Fvb4:19701844-19702144", "Fvb4:19187299-19187599",
          "Fvb4:19069959-19070259", "Fvb4:17400456-17400756",
          "Fvb4:14051638-14051938", "Fvb4:14021774-14022074",
          "Fvb4:13606290-13606590", "Fvb4:13512262-13512562",
          "Fvb4:13420907-13421207", "Fvb4:13270884-13271184",
          "Fvb4:12594204-12594504", "Fvb4:11990654-11990954",
          "Fvb4:10719229-10719529", "Fvb4:10470480-10470780",
          "Fvb3:4786032-4786332", "Fvb3:35497020-35497320",
          "Fvb3:3078483-3078783", "Fvb3:26353071-26353371",
          "Fvb3:26252712-26253012", "Fvb3:25361528-25361828",
          "Fvb3:19619206-19619506", "Fvb3:10632973-10633273",
          "Fvb3:10313422-10313722", "Fvb2:7455768-7456068",
          "Fvb2:4767102-4767402", "Fvb2:24911429-24911729",
          "Fvb2:19525960-19526260", "Fvb2:18638651-18638951",
          "Fvb2:1354772-1355072", "Fvb1:3319116-3319416",
          "Fvb1:23379839-23380139", "Fvb1:23168891-23169191",
          "Fvb1:22797435-22797735", "Fvb1:20378437-20378737",
          "Fvb1:13884569-13884869", "Fvb7:15392059-15392359",
          "Fvb4:21026308-21026608", "Fvb1:19895953-19896253",
          "Fvb6:18509986-18510286", "Fvb4:13003782-13004082",
          "Fvb5:17094203-17094503", "Fvb4:12960782-12961082",
          "Fvb4:28266172-28266472", "Fvb4:12308078-12308378",
          "Fvb1:20219870-20220170", "Fvb5:21503283-21503583",
          "Fvb4:3022855-3023155", "Fvb6:38846238-38846538",
          "Fvb6:12869167-12869467", "Fvb4:24725478-24725778",
          "Fvb4:11499280-11499580", "Fvb2:8937748-8938048",
          "Fvb2:11962645-11962945", "Fvb1:5199048-5199348",
          "Fvb6:13736129-13736429", "Fvb1:5457151-5457451",
          "Fvb4:10288943-10289243", "Fvb6:26290740-26291040",
          "Fvb6:18769428-18769728", "Fvb6:16866833-16867133",
          "Fvb4:6245547-6245847", "Fvb3:5868355-5868655",
          "Fvb6:3015262-3015562", "Fvb5:28233419-28233719",
          "Fvb5:20934479-20934779", "Fvb4:13093735-13094035",
          "Fvb4:11845398-11845698", "Fvb2:8870608-8870908",
          "Fvb2:26839711-26840011", "Fvb1:956873-957173",
          "Fvb1:22778352-22778652", "Fvb5:11022831-11023131",
          "Fvb4:11506524-11506824", "Fvb5:17388861-17389161",
          "Fvb4:11264934-11265234", "Fvb1:22469748-22470048",
          "Fvb4:13236442-13236742", "Fvb7:13461971-13462271",
          "Fvb6:29138628-29138928", "Fvb6:2028565-2028865",
          "Fvb6:11732845-11733145", "Fvb3:28395808-28396108",
          "Fvb2:28433596-28433896", "Fvb1:14381637-14381937",
          "Fvb7:21685963-21686263", "Fvb4:9607640-9607940",
          "Fvb7:5806158-5806458", "Fvb6:9821109-9821409",
          "Fvb6:33415986-33416286", "Fvb4:27440578-27440878",
          "Fvb4:10271719-10272019", "Fvb4:22945689-22945989",
          "Fvb5:19382145-19382445", "Fvb1:23516349-23516649",
          "Fvb5:26704371-26704671", "Fvb7:9156106-9156406",
          "Fvb7:831934-832234", "Fvb7:2559839-2560139",
          "Fvb6:7943202-7943502", "Fvb6:35930619-35930919",
          "Fvb6:34606282-34606582", "Fvb6:22887618-22887918",
          "Fvb6:1267030-1267330", "Fvb6:12570415-12570715",
          "Fvb5:28812988-28813288", "Fvb5:28200031-28200331",
          "Fvb5:27378586-27378886", "Fvb5:26412931-26413231",
          "Fvb5:16233272-16233572", "Fvb5:11975701-11976001",
          "Fvb4:9527085-9527385", "Fvb4:4727332-4727632",
          "Fvb4:33755030-33755330", "Fvb4:33028368-33028668",
          "Fvb4:30728526-30728826", "Fvb4:30661537-30661837",
          "Fvb4:26257770-26258070", "Fvb4:25739409-25739709",
          "Fvb4:23146606-23146906", "Fvb4:1798427-1798727",
          "Fvb4:16481980-16482280", "Fvb4:14290766-14291066",
          "Fvb4:11332445-11332745", "Fvb4:11255265-11255565",
          "Fvb4:11125053-11125353", "Fvb4:10973104-10973404",
          "Fvb3:8317116-8317416", "Fvb3:5135707-5136007",
          "Fvb3:4144520-4144820", "Fvb3:3954198-3954498",
          "Fvb3:32580071-32580371", "Fvb3:28308905-28309205",
          "Fvb3:26883798-26884098", "Fvb3:26362908-26363208",
          "Fvb3:25787392-25787692", "Fvb3:25579883-25580183",
          "Fvb3:25486312-25486612", "Fvb3:22758649-22758949",
          "Fvb3:19002278-19002578", "Fvb3:16423842-16424142",
          "Fvb3:12893233-12893533", "Fvb2:7031419-7031719",
          "Fvb2:6337827-6338127", "Fvb2:28357754-28358054",
          "Fvb2:21102603-21102903", "Fvb2:14574063-14574363",
          "Fvb2:10920975-10921275", "Fvb1:8232499-8232799",
          "Fvb1:7322996-7323296", "Fvb1:5512850-5513150",
          "Fvb1:2310429-2310729", "Fvb1:22329417-22329717",
          "Fvb1:22199555-22199855", "Fvb1:21588462-21588762",
          "Fvb1:20170327-20170627", "Fvb1:13143364-13143664",
          "Fvb1:10919886-10920186", "Fvb4:32088461-32088761",
          "Fvb5:8561379-8561679", "Fvb5:14958436-14958736",
          "Fvb4:8794325-8794625", "Fvb3:18900919-18901219",
          "Fvb3:10079613-10079913", "Fvb7:14077642-14077942",
          "Fvb2:24928604-24928904", "Fvb6:29877186-29877486",
          "Fvb6:2979715-2980015", "Fvb4:26439928-26440228",
          "Fvb4:23969231-23969531", "Fvb3:26208778-26209078",
          "Fvb3:24278213-24278513", "Fvb6:38269906-38270206",
          "Fvb7:2371819-2372119", "Fvb4:14067695-14067995",
          "Fvb1:16324896-16325196", "Fvb6:10760273-10760573",
          "Fvb4:6140476-6140776", "Fvb3:5330360-5330660",
          "Fvb1:22471427-22471727", "Fvb2:9254928-9255228",
          "Fvb4:31952738-31953038", "Fvb4:25801178-25801478",
          "Fvb5:22629791-22630091", "Fvb4:29813992-29814292",
          "Fvb2:8585261-8585561", "Fvb1:16720289-16720589",
          "Fvb5:11669183-11669483", "Fvb7:17922787-17923087",
          "Fvb5:823208-823508", "Fvb5:8898662-8898962",
          "Fvb4:8091498-8091798", "Fvb2:27455424-27455724",
          "Fvb2:25122122-25122422", "Fvb1:7581220-7581520",
          "Fvb6:21711149-21711449", "Fvb6:19640880-19641180",
          "Fvb2:21145536-21145836", "Fvb1:11062907-11063207",
          "Fvb7:20796848-20797148", "Fvb6:15893319-15893619",
          "Fvb4:9659528-9659828", "Fvb3:9409518-9409818",
          "Fvb2:3645915-3646215", "Fvb2:24643609-24643909",
          "Fvb1:21453486-21453786", "Fvb5:7216636-7216936",
          "Fvb6:38105174-38105474", "Fvb6:13974812-13975112",
          "Fvb2:4469900-4470200", "Fvb3:23201195-23201495",
          "Fvb5:29363230-29363530", "Fvb4:10636131-10636431",
          "Fvb7:2306000-2306300", "Fvb7:16605737-16606037",
          "Fvb7:12419215-12419515", "Fvb6:37571894-37572194",
          "Fvb6:35045409-35045709", "Fvb6:32542776-32543076",
          "Fvb6:32523683-32523983", "Fvb6:25401530-25401830",
          "Fvb6:21608753-21609053", "Fvb6:1894376-1894676",
          "Fvb6:17617614-17617914", "Fvb6:17409042-17409342",
          "Fvb6:14734136-14734436", "Fvb6:12557434-12557734",
          "Fvb6:12381792-12382092", "Fvb6:12095044-12095344",
          "Fvb5:6228904-6229204", "Fvb5:3251773-3252073",
          "Fvb5:25916966-25917266", "Fvb5:16474749-16475049",
          "Fvb5:15750417-15750717", "Fvb5:15454583-15454883",
          "Fvb5:11654310-11654610", "Fvb5:11385994-11386294",
          "Fvb5:10493310-10493610", "Fvb4:8394440-8394740",
          "Fvb4:3532504-3532804", "Fvb4:23872536-23872836",
          "Fvb4:20549329-20549629", "Fvb4:20103324-20103624",
          "Fvb4:14300846-14301146", "Fvb4:14104232-14104532",
          "Fvb4:13375488-13375788", "Fvb4:13254915-13255215",
          "Fvb4:13229951-13230251", "Fvb4:11838458-11838758",
          "Fvb4:11626910-11627210", "Fvb4:11596273-11596573",
          "Fvb4:11447985-11448285", "Fvb4:11445856-11446156",
          "Fvb4:1141254-1141554", "Fvb4:10575207-10575507",
          "Fvb4:10022307-10022607", "Fvb3:3491053-3491353",
          "Fvb3:3356259-3356559", "Fvb3:33179173-33179473",
          "Fvb3:25913111-25913411", "Fvb3:25191146-25191446",
          "Fvb3:24602557-24602857", "Fvb3:21405488-21405788",
          "Fvb3:16496444-16496744", "Fvb3:11918448-11918748",
          "Fvb2:24289556-24289856", "Fvb2:18869901-18870201",
          "Fvb2:15159617-15159917", "Fvb2:147334-147634",
          "Fvb2:12861398-12861698", "Fvb2:11149714-11150014",
          "Fvb2:10311179-10311479", "Fvb1:9822981-9823281",
          "Fvb1:23360919-23361219", "Fvb1:22196593-22196893",
          "Fvb1:20416754-20417054", "Fvb1:20014837-20015137",
          "Fvb1:19732974-19733274", "Fvb1:18450138-18450438",
          "Fvb1:17064689-17064989", "Fvb1:14001828-14002128",
          "Fvb6:17783865-17784165", "Fvb5:1420726-1421026",
          "Fvb4:12557811-12558111", "Fvb2:327825-328125",
          "Fvb6:35910026-35910326", "Fvb6:29850586-29850886",
          "Fvb4:11140211-11140511", "Fvb3:32080436-32080736",
          "Fvb2:349010-349310", "Fvb2:18520412-18520712",
          "Fvb5:29178592-29178892", "Fvb3:3783057-3783357",
          "Fvb6:16025372-16025672", "Fvb4:11613684-11613984",
          "Fvb3:33013135-33013435", "Fvb4:10638804-10639104",
          "Fvb3:26974280-26974580", "Fvb7:4078602-4078902",
          "Fvb7:17498285-17498585", "Fvb5:27564886-27565186",
          "Fvb3:34321010-34321310", "Fvb3:26747762-26748062",
          "Fvb3:25121154-25121454", "Fvb3:11802879-11803179",
          "Fvb2:14088677-14088977", "Fvb5:14238193-14238493",
          "Fvb3:582518-582818", "Fvb2:18107377-18107677",
          "Fvb4:14098025-14098325", "Fvb2:4437273-4437573",
          "Fvb5:3504161-3504461", "Fvb3:8795053-8795353",
          "Fvb7:3569868-3570168", "Fvb6:35361686-35361986",
          "Fvb2:27365038-27365338", "Fvb5:12568341-12568641",
          "Fvb6:37375480-37375780", "Fvb1:13173538-13173838",
          "Fvb1:1224950-1225250", "Fvb7:6561654-6561954",
          "Fvb7:20694097-20694397", "Fvb6:28923917-28924217",
          "Fvb5:21005912-21006212", "Fvb4:10110805-10111105",
          "Fvb3:24498951-24499251", "Fvb2:26239638-26239938",
          "Fvb1:1348407-1348707", "Fvb5:10227526-10227826",
          "Fvb2:24998905-24999205", "Fvb2:19527930-19528230",
          "Fvb5:12990305-12990605", "Fvb5:9304316-9304616",
          "Fvb4:15439273-15439573", "Fvb7:8593928-8594228",
          "Fvb7:8482130-8482430", "Fvb7:4720563-4720863",
          "Fvb7:2458600-2458900", "Fvb7:19526484-19526784",
          "Fvb7:19308481-19308781", "Fvb7:12164986-12165286",
          "Fvb7:10107464-10107764", "Fvb6:9987480-9987780",
          "Fvb6:8476900-8477200", "Fvb6:7948259-7948559",
          "Fvb6:29406560-29406860", "Fvb6:26192240-26192540",
          "Fvb6:24483431-24483731", "Fvb6:23494927-23495227",
          "Fvb6:11957895-11958195", "Fvb6:11114768-11115068",
          "Fvb5:4391157-4391457", "Fvb5:26514018-26514318",
          "Fvb5:23991062-23991362", "Fvb5:2209443-2209743",
          "Fvb5:21598753-21599053", "Fvb5:1816035-1816335",
          "Fvb5:16057847-16058147", "Fvb5:15509825-15510125",
          "Fvb5:12938392-12938692", "Fvb5:12685617-12685917",
          "Fvb5:11213706-11214006", "Fvb5:10008420-10008720",
          "Fvb4:9712430-9712730", "Fvb4:9077741-9078041",
          "Fvb4:8724403-8724703", "Fvb4:7971045-7971345",
          "Fvb4:33237734-33238034", "Fvb4:32550742-32551042",
          "Fvb4:30685146-30685446", "Fvb4:29511162-29511462",
          "Fvb4:15959045-15959345", "Fvb4:13872906-13873206",
          "Fvb4:13763485-13763785", "Fvb4:13354349-13354649",
          "Fvb4:13048456-13048756", "Fvb4:10344834-10345134",
          "Fvb3:7973849-7974149", "Fvb3:577351-577651",
          "Fvb3:35691881-35692181", "Fvb3:34355280-34355580",
          "Fvb3:32949252-32949552", "Fvb3:32502103-32502403",
          "Fvb3:32332548-32332848", "Fvb3:28653279-28653579",
          "Fvb3:27604312-27604612", "Fvb3:27166816-27167116",
          "Fvb3:25682643-25682943", "Fvb3:24996340-24996640",
          "Fvb3:23210834-23211134", "Fvb3:23136925-23137225",
          "Fvb3:22221588-22221888", "Fvb3:20890792-20891092",
          "Fvb3:20335354-20335654", "Fvb3:19835691-19835991",
          "Fvb3:15513796-15514096", "Fvb3:15293975-15294275",
          "Fvb3:13372270-13372570", "Fvb2:9364671-9364971",
          "Fvb2:7183214-7183514", "Fvb2:28851853-28852153",
          "Fvb2:23914809-23915109", "Fvb2:21455838-21456138",
          "Fvb2:20574450-20574750", "Fvb2:17243824-17244124",
          "Fvb2:15753955-15754255", "Fvb2:10638799-10639099",
          "Fvb1:8938044-8938344", "Fvb1:8778784-8779084",
          "Fvb1:811113-811413", "Fvb1:6754828-6755128",
          "Fvb1:23054096-23054396", "Fvb1:22856813-22857113",
          "Fvb1:19519475-19519775", "Fvb1:19216733-19217033",
          "Fvb1:18329744-18330044", "Fvb1:16824525-16824825",
          "Fvb1:14307700-14308000", "Fvb6:8953798-8954098",
          "Fvb5:9934257-9934557", "Fvb4:9475159-9475459",
          "Fvb4:28909273-28909573", "Fvb3:10987418-10987718",
          "Fvb2:23722445-23722745", "Fvb1:22953402-22953702",
          "Fvb1:19227001-19227301", "Fvb3:4473170-4473470",
          "Fvb7:23358848-23359148", "Fvb7:16232236-16232536",
          "Fvb3:1136741-1137041", "Fvb4:14575821-14576121",
          "Fvb7:14066087-14066387", "Fvb3:25476877-25477177",
          "Fvb2:5123970-5124270", "Fvb1:12010713-12011013",
          "Fvb4:8434350-8434650", "Fvb3:13837069-13837369",
          "Fvb5:4874232-4874532", "Fvb1:8498568-8498868",
          "Fvb7:22429258-22429558", "Fvb6:33080237-33080537",
          "Fvb5:7070198-7070498", "Fvb5:23380125-23380425",
          "Fvb4:9047551-9047851", "Fvb4:7472393-7472693",
          "Fvb3:9056031-9056331", "Fvb3:22047703-22048003",
          "Fvb1:4860589-4860889", "Fvb6:7633870-7634170",
          "Fvb4:12420609-12420909", "Fvb4:1191958-1192258",
          "Fvb4:10580287-10580587", "Fvb4:4034100-4034400",
          "Fvb7:8008892-8009192", "Fvb7:6095726-6096026",
          "Fvb2:6314636-6314936", "Fvb1:20371409-20371709",
          "Fvb5:9009218-9009518", "Fvb5:27178835-27179135",
          "Fvb5:18699879-18700179", "Fvb2:9266079-9266379",
          "Fvb2:12762868-12763168", "Fvb4:33837879-33838179",
          "Fvb3:27815961-27816261", "Fvb4:7894297-7894597",
          "Fvb6:12040743-12041043", "Fvb6:24342041-24342341",
          "Fvb4:18899480-18899780", "Fvb7:2427525-2427825",
          "Fvb6:35624140-35624440", "Fvb5:23370369-23370669",
          "Fvb4:6133937-6134237", "Fvb3:21970491-21970791",
          "Fvb1:23838149-23838449", "Fvb2:17179493-17179793",
          "Fvb1:20423959-20424259", "Fvb5:23264180-23264480",
          "Fvb2:18155018-18155318", "Fvb1:20319125-20319425",
          "Fvb4:9375772-9376072", "Fvb7:716029-716329",
          "Fvb7:23450381-23450681", "Fvb7:21632034-21632334",
          "Fvb7:21527495-21527795", "Fvb7:1217771-1218071",
          "Fvb6:7644047-7644347", "Fvb6:37177773-37178073",
          "Fvb6:33070731-33071031", "Fvb6:2057013-2057313",
          "Fvb6:19990215-19990515", "Fvb6:14244313-14244613",
          "Fvb6:13780695-13780995", "Fvb5:8148396-8148696",
          "Fvb5:8067335-8067635", "Fvb5:3104045-3104345",
          "Fvb5:25813144-25813444", "Fvb5:23582842-23583142",
          "Fvb5:22655180-22655480", "Fvb5:22581935-22582235",
          "Fvb5:16753912-16754212", "Fvb5:15372894-15373194",
          "Fvb5:15238060-15238360", "Fvb5:14949660-14949960",
          "Fvb4:9985361-9985661", "Fvb4:9226600-9226900",
          "Fvb4:9013863-9014163", "Fvb4:6781682-6781982",
          "Fvb4:6196110-6196410", "Fvb4:5692506-5692806",
          "Fvb4:33255754-33256054", "Fvb4:30639270-30639570",
          "Fvb4:25306576-25306876", "Fvb4:19838756-19839056",
          "Fvb4:19341871-19342171", "Fvb4:18753728-18754028",
          "Fvb4:18578639-18578939", "Fvb4:17551291-17551591",
          "Fvb4:15948525-15948825", "Fvb4:15883960-15884260",
          "Fvb4:14311006-14311306", "Fvb4:12272775-12273075",
          "Fvb4:12164302-12164602", "Fvb4:1144546-1144846",
          "Fvb4:10852873-10853173", "Fvb4:10701289-10701589",
          "Fvb3:27352992-27353292", "Fvb3:25993412-25993712",
          "Fvb3:25647351-25647651", "Fvb3:19422900-19423200",
          "Fvb2:7324615-7324915", "Fvb2:6992575-6992875",
          "Fvb2:4894061-4894361", "Fvb2:405985-406285",
          "Fvb2:27383280-27383580", "Fvb2:21493450-21493750",
          "Fvb2:21363775-21364075", "Fvb2:17316528-17316828",
          "Fvb2:15529754-15530054", "Fvb2:15379692-15379992",
          "Fvb1:6390499-6390799", "Fvb1:22192237-22192537",
          "Fvb1:19831890-19832190", "Fvb1:19768519-19768819",
          "Fvb1:19552721-19553021", "Fvb1:17423871-17424171",
          "Fvb1:16410748-16411048", "Fvb2:13338850-13339150",
          "Fvb7:19072450-19072750", "Fvb3:26862733-26863033",
          "Fvb3:7299848-7300148", "Fvb7:22952622-22952922",
          "Fvb7:16979924-16980224", "Fvb6:14786720-14787020",
          "Fvb6:22700894-22701194", "Fvb2:16813080-16813380",
          "Fvb1:7639399-7639699", "Fvb7:23217722-23218022",
          "Fvb3:499838-500138", "Fvb1:22577053-22577353",
          "Fvb6:17716473-17716773", "Fvb7:20584102-20584402",
          "Fvb5:988089-988389", "Fvb4:9980806-9981106",
          "Fvb4:4799544-4799844", "Fvb4:13102763-13103063",
          "Fvb4:12696105-12696405", "Fvb2:7844604-7844904",
          "Fvb2:20212777-20213077", "Fvb5:16254302-16254602",
          "Fvb6:35024111-35024411", "Fvb4:8798377-8798677",
          "Fvb3:24769040-24769340", "Fvb2:17202174-17202474",
          "Fvb6:22070117-22070417", "Fvb7:7043563-7043863",
          "Fvb5:3291300-3291600", "Fvb4:6847544-6847844",
          "Fvb7:850060-850360", "Fvb6:24719898-24720198",
          "Fvb6:17787631-17787931", "Fvb5:4026037-4026337",
          "Fvb4:6063278-6063578", "Fvb4:11249580-11249880",
          "Fvb3:26800177-26800477", "Fvb3:25407556-25407856",
          "Fvb2:10453522-10453822", "Fvb1:18153882-18154182",
          "Fvb4:606112-606412", "Fvb6:14486854-14487154",
          "Fvb4:6881766-6882066", "Fvb5:9808244-9808544",
          "Fvb5:20087836-20088136", "Fvb4:13451728-13452028",
          "Fvb4:13313550-13313850", "Fvb4:10303568-10303868",
          "Fvb3:25544003-25544303", "Fvb3:21459447-21459747",
          "Fvb3:12614351-12614651", "Fvb3:10085601-10085901",
          "Fvb2:4543551-4543851", "Fvb1:9877533-9877833",
          "Fvb1:6125276-6125576", "Fvb7:829792-830092",
          "Fvb7:19591335-19591635", "Fvb1:3782195-3782495",
          "Fvb6:8393855-8394155", "Fvb5:22656189-22656489",
          "Fvb6:12138265-12138565", "Fvb2:24504125-24504425",
          "Fvb7:5414142-5414442", "Fvb7:4178256-4178556",
          "Fvb7:19828788-19829088", "Fvb4:6164818-6165118",
          "Fvb4:31949660-31949960", "Fvb4:28844246-28844546",
          "Fvb3:23909807-23910107", "Fvb3:15925229-15925529",
          "Fvb3:10856534-10856834", "Fvb2:14696181-14696481",
          "Fvb1:19219870-19220170", "Fvb7:11136267-11136567",
          "Fvb5:28115761-28116061", "Fvb4:26291351-26291651",
          "Fvb3:501826-502126", "Fvb3:26645028-26645328",
          "Fvb3:2657339-2657639", "Fvb2:21964426-21964726",
          "Fvb2:10026384-10026684", "Fvb7:4423500-4423800",
          "Fvb7:2447814-2448114", "Fvb7:13132375-13132675",
          "Fvb6:6801063-6801363", "Fvb6:6365501-6365801",
          "Fvb6:3536305-3536605", "Fvb6:31127496-31127796",
          "Fvb6:30365334-30365634", "Fvb6:26336558-26336858",
          "Fvb6:24110560-24110860", "Fvb6:22370317-22370617",
          "Fvb6:20401854-20402154", "Fvb6:18021119-18021419",
          "Fvb6:15771594-15771894", "Fvb6:13559487-13559787",
          "Fvb6:13160210-13160510", "Fvb6:11887025-11887325",
          "Fvb5:9000783-9001083", "Fvb5:27827092-27827392",
          "Fvb5:250598-250898", "Fvb5:24457032-24457332",
          "Fvb5:24015164-24015464", "Fvb5:22204467-22204767",
          "Fvb5:2134366-2134666", "Fvb5:19385411-19385711",
          "Fvb5:16650943-16651243", "Fvb5:15016953-15017253",
          "Fvb5:14314415-14314715", "Fvb5:13374972-13375272",
          "Fvb5:10132394-10132694", "Fvb4:926266-926566",
          "Fvb4:8623636-8623936", "Fvb4:7795260-7795560",
          "Fvb4:541470-541770", "Fvb4:5174070-5174370",
          "Fvb4:33374035-33374335", "Fvb4:26368604-26368904",
          "Fvb4:2016442-2016742", "Fvb4:20070780-20071080",
          "Fvb4:19454296-19454596", "Fvb4:15519502-15519802",
          "Fvb4:14179730-14180030", "Fvb4:13725204-13725504",
          "Fvb4:13563105-13563405", "Fvb4:13495609-13495909",
          "Fvb4:12348487-12348787", "Fvb4:11571282-11571582",
          "Fvb4:10971141-10971441", "Fvb4:10512538-10512838",
          "Fvb4:10050562-10050862", "Fvb3:4078263-4078563",
          "Fvb3:38314222-38314522", "Fvb3:37109188-37109488",
          "Fvb3:28294915-28295215", "Fvb3:26321314-26321614",
          "Fvb3:24728583-24728883", "Fvb3:19759787-19760087",
          "Fvb3:19325513-19325813", "Fvb3:14877250-14877550",
          "Fvb3:14328832-14329132", "Fvb2:3932894-3933194",
          "Fvb2:27692359-27692659", "Fvb2:27530337-27530637",
          "Fvb2:26085078-26085378", "Fvb2:25640570-25640870",
          "Fvb2:24655421-24655721", "Fvb2:22537016-22537316",
          "Fvb2:21811525-21811825", "Fvb2:14993249-14993549",
          "Fvb2:14536364-14536664", "Fvb2:139350-139650",
          "Fvb2:13482823-13483123", "Fvb1:6826598-6826898",
          "Fvb1:3810310-3810610", "Fvb1:23112937-23113237",
          "Fvb1:20671584-20671884", "Fvb1:19619242-19619542",
          "Fvb1:16759915-16760215", "Fvb1:14216422-14216722",
          "Fvb1:13237554-13237854", "Fvb1:10767568-10767868",
          "contig_5:17967-18267", "Fvb3:9857239-9857539",
          "Fvb3:3573811-3574111", "Fvb4:12586811-12587111",
          "Fvb6:32644109-32644409", "Fvb6:25584489-25584789",
          "Fvb6:15159927-15160227", "Fvb1:21557651-21557951",
          "Fvb1:11444455-11444755", "Fvb5:25846829-25847129",
          "Fvb4:25974730-25975030", "Fvb7:1437346-1437646",
          "Fvb2:8088064-8088364", "Fvb2:20635878-20636178",
          "Fvb2:21854387-21854687", "Fvb1:5171135-5171435",
          "Fvb1:15347175-15347475", "Fvb7:23395119-23395419",
          "Fvb7:13258757-13259057", "Fvb4:6118817-6119117",
          "Fvb6:35935414-35935714", "Fvb6:10870009-10870309",
          "Fvb5:29358369-29358669", "Fvb4:25792801-25793101",
          "Fvb4:13858151-13858451", "Fvb3:25461728-25462028",
          "Fvb1:22927615-22927915", "Fvb3:29607840-29608140",
          "Fvb7:1137503-1137803", "Fvb6:3364620-3364920",
          "Fvb6:39220823-39221123", "Fvb7:4074574-4074874",
          "Fvb6:24057432-24057732", "Fvb3:4379338-4379638",
          "Fvb6:27241163-27241463", "Fvb4:9924920-9925220",
          "Fvb4:9883659-9883959", "Fvb4:25137616-25137916",
          "Fvb4:12523832-12524132", "Fvb3:6930469-6930769",
          "Fvb3:34364200-34364500", "Fvb2:14092299-14092599",
          "Fvb2:11688295-11688595", "Fvb1:23106735-23107035",
          "Fvb6:21769950-21770250", "Fvb5:22560358-22560658",
          "Fvb4:8056726-8057026", "Fvb4:28913753-28914053",
          "Fvb6:20250172-20250472", "Fvb3:15703684-15703984",
          "Fvb2:16809369-16809669", "Fvb7:18653404-18653704",
          "Fvb5:2268277-2268577", "Fvb6:15305698-15305998",
          "Fvb3:27324103-27324403", "Fvb6:38392976-38393276",
          "Fvb6:1720187-1720487", "Fvb6:13476764-13477064",
          "Fvb5:22488087-22488387", "Fvb4:3735916-3736216",
          "Fvb4:18874015-18874315", "Fvb3:26389804-26390104",
          "Fvb2:7401694-7401994", "Fvb1:15725803-15726103",
          "Fvb7:9782558-9782858", "Fvb7:5410669-5410969",
          "Fvb7:3692843-3693143", "Fvb7:18779975-18780275",
          "Fvb7:17831444-17831744", "Fvb7:12930109-12930409",
          "Fvb7:11344901-11345201", "Fvb7:11297153-11297453",
          "Fvb6:8319665-8319965", "Fvb6:4998188-4998488",
          "Fvb6:23239355-23239655", "Fvb6:17135434-17135734",
          "Fvb6:16999790-17000090", "Fvb6:15691208-15691508",
          "Fvb6:14932007-14932307", "Fvb6:14509365-14509665",
          "Fvb6:11081508-11081808", "Fvb5:2512376-2512676",
          "Fvb5:22705556-22705856", "Fvb5:22409417-22409717",
          "Fvb5:20264813-20265113", "Fvb5:18774253-18774553",
          "Fvb5:14086203-14086503", "Fvb4:8662800-8663100",
          "Fvb4:8588000-8588300", "Fvb4:6958825-6959125",
          "Fvb4:6546554-6546854", "Fvb4:6358796-6359096",
          "Fvb4:5151927-5152227", "Fvb4:506224-506524",
          "Fvb4:22683355-22683655", "Fvb4:20195027-20195327",
          "Fvb4:15963098-15963398", "Fvb4:13546106-13546406",
          "Fvb4:12358787-12359087", "Fvb4:10915083-10915383",
          "Fvb4:10150679-10150979", "Fvb3:31833702-31834002",
          "Fvb3:30987352-30987652", "Fvb3:26430184-26430484",
          "Fvb3:26424145-26424445", "Fvb3:26416547-26416847",
          "Fvb3:26139424-26139724", "Fvb3:26028581-26028881",
          "Fvb3:25473881-25474181", "Fvb3:25468442-25468742",
          "Fvb3:23344999-23345299", "Fvb3:22409618-22409918",
          "Fvb3:19397979-19398279", "Fvb3:18199114-18199414",
          "Fvb3:17791176-17791476", "Fvb3:17154290-17154590",
          "Fvb3:16508028-16508328", "Fvb3:14387496-14387796",
          "Fvb3:13862844-13863144", "Fvb3:12865784-12866084",
          "Fvb3:12659896-12660196", "Fvb2:8181895-8182195",
          "Fvb2:816836-817136", "Fvb2:5806240-5806540",
          "Fvb2:3167921-3168221", "Fvb2:18645696-18645996",
          "Fvb2:17803643-17803943", "Fvb2:15719694-15719994",
          "Fvb2:12787945-12788245", "Fvb2:10197780-10198080",
          "Fvb1:6918660-6918960", "Fvb1:5443508-5443808",
          "Fvb1:22695042-22695342", "Fvb1:22619319-22619619",
          "Fvb1:22013911-22014211", "Fvb1:19621620-19621920",
          "Fvb6:12196326-12196626", "Fvb2:25566316-25566616",
          "Fvb2:15264763-15265063", "Fvb6:36387116-36387416",
          "Fvb4:7973861-7974161", "Fvb3:31627995-31628295",
          "Fvb6:24577613-24577913", "Fvb6:21778804-21779104",
          "Fvb2:28074140-28074440", "Fvb6:35848264-35848564",
          "Fvb5:5956027-5956327", "Fvb1:10816634-10816934",
          "Fvb1:10057507-10057807", "Fvb3:3904921-3905221",
          "Fvb7:5288571-5288871", "Fvb7:20641144-20641444",
          "Fvb6:7325194-7325494", "Fvb6:31154482-31154782",
          "Fvb6:1290614-1290914", "Fvb5:26843943-26844243",
          "Fvb5:15046635-15046935", "Fvb4:13210096-13210396",
          "Fvb4:11342053-11342353", "Fvb4:10941367-10941667",
          "Fvb4:10711141-10711441", "Fvb3:5019176-5019476",
          "Fvb1:23385286-23385586", "Fvb1:19836686-19836986",
          "Fvb7:23080342-23080642", "Fvb1:1472539-1472839",
          "Fvb7:3780980-3781280", "Fvb5:11860841-11861141",
          "Fvb2:5842170-5842470", "Fvb1:21167746-21168046",
          "Fvb1:14995141-14995441", "Fvb6:17878523-17878823",
          "Fvb4:2007268-2007568", "Fvb7:11595222-11595522",
          "Fvb6:25231912-25232212", "Fvb1:6293763-6294063",
          "Fvb4:27396654-27396954", "Fvb7:15089675-15089975",
          "Fvb5:25368639-25368939", "Fvb4:10336454-10336754",
          "Fvb4:12674148-12674448", "Fvb4:11840646-11840946",
          "Fvb7:22190985-22191285", "Fvb7:2123823-2124123",
          "Fvb6:21374184-21374484", "Fvb5:28918576-28918876",
          "Fvb3:20293260-20293560", "Fvb2:283826-284126",
          "Fvb2:25591245-25591545", "Fvb2:21313646-21313946",
          "Fvb4:2024795-2025095", "Fvb5:17653474-17653774",
          "Fvb1:22259767-22260067", "Fvb1:20261772-20262072",
          "Fvb6:7645839-7646139", "Fvb7:17622543-17622843",
          "Fvb7:16009761-16010061", "Fvb6:6826100-6826400",
          "Fvb6:10586167-10586467", "Fvb5:6803552-6803852",
          "Fvb4:19326755-19327055", "Fvb3:37754526-37754826",
          "Fvb2:709669-709969", "Fvb1:21281841-21282141",
          "Fvb3:875994-876294", "Fvb2:3910079-3910379",
          "Fvb4:13440282-13440582", "Fvb7:23046742-23047042",
          "Fvb7:21978159-21978459", "Fvb6:35728806-35729106",
          "Fvb6:34275641-34275941", "Fvb6:24784225-24784525",
          "Fvb6:2439289-2439589", "Fvb6:23545935-23546235",
          "Fvb6:21788526-21788826", "Fvb6:18352549-18352849",
          "Fvb6:17868296-17868596", "Fvb6:12951973-12952273",
          "Fvb5:9835161-9835461", "Fvb5:9478759-9479059",
          "Fvb5:7631670-7631970", "Fvb5:7558361-7558661",
          "Fvb5:27568284-27568584", "Fvb5:23969391-23969691",
          "Fvb5:1895937-1896237", "Fvb5:18533439-18533739",
          "Fvb5:16429098-16429398", "Fvb5:16046976-16047276",
          "Fvb4:8825642-8825942", "Fvb4:6340831-6341131",
          "Fvb4:5148636-5148936", "Fvb4:4818664-4818964",
          "Fvb4:4064684-4064984", "Fvb4:24149145-24149445",
          "Fvb4:23810291-23810591", "Fvb4:23482734-23483034",
          "Fvb4:21592479-21592779", "Fvb4:19722350-19722650",
          "Fvb4:192824-193124", "Fvb4:19159606-19159906",
          "Fvb4:17138857-17139157", "Fvb4:16741389-16741689",
          "Fvb4:15413159-15413459", "Fvb4:13752308-13752608",
          "Fvb4:13469824-13470124", "Fvb4:13350557-13350857",
          "Fvb4:12853501-12853801", "Fvb4:12494397-12494697",
          "Fvb4:12401626-12401926", "Fvb4:11631976-11632276",
          "Fvb4:10862959-10863259", "Fvb3:29690478-29690778",
          "Fvb3:29133474-29133774", "Fvb3:27895078-27895378",
          "Fvb3:26727838-26728138", "Fvb3:26566983-26567283",
          "Fvb3:26386709-26387009", "Fvb3:26341573-26341873",
          "Fvb3:26316739-26317039", "Fvb3:26105177-26105477",
          "Fvb3:24427183-24427483", "Fvb3:23922312-23922612",
          "Fvb3:2201674-2201974", "Fvb3:21119539-21119839",
          "Fvb3:19039593-19039893", "Fvb3:18340460-18340760",
          "Fvb3:12620156-12620456", "Fvb2:88302-88602",
          "Fvb2:25215491-25215791", "Fvb2:2469598-2469898",
          "Fvb2:22260129-22260429", "Fvb2:19837789-19838089",
          "Fvb2:19698778-19699078", "Fvb2:15595378-15595678",
          "Fvb1:9550753-9551053", "Fvb1:9091639-9091939",
          "Fvb1:5284497-5284797", "Fvb1:22291104-22291404",
          "Fvb1:20302576-20302876", "Fvb1:17556515-17556815",
          "contig_5:42040-42340", "Fvb7:13652990-13653290",
          "Fvb5:9723328-9723628", "Fvb2:4135905-4136205",
          "Fvb5:21858865-21859165", "Fvb3:1220518-1220818",
          "Fvb2:27793871-27794171", "Fvb2:10689148-10689448",
          "Fvb4:27388859-27389159", "Fvb3:14449252-14449552",
          "Fvb1:23010452-23010752", "Fvb2:17581608-17581908",
          "Fvb7:2823038-2823338", "Fvb1:20052794-20053094",
          "Fvb7:5498179-5498479", "Fvb6:18618102-18618402",
          "Fvb5:16756566-16756866", "Fvb4:18972780-18973080",
          "Fvb4:12501555-12501855", "Fvb2:23544218-23544518",
          "Fvb1:3832482-3832782", "Fvb1:1051632-1051932",
          "Fvb5:26437864-26438164", "Fvb4:8936099-8936399",
          "Fvb4:8934423-8934723", "Fvb4:19334810-19335110",
          "Fvb3:27585923-27586223", "Fvb3:12604296-12604596",
          "Fvb3:10484997-10485297", "Fvb2:714949-715249",
          "Fvb1:19549690-19549990", "Fvb6:4717123-4717423",
          "Fvb4:11155706-11156006", "Fvb4:13554337-13554637",
          "Fvb3:11582777-11583077", "Fvb6:10249288-10249588",
          "Fvb6:32200449-32200749", "Fvb1:7096715-7097015",
          "Fvb4:6837859-6838159", "Fvb3:22533490-22533790",
          "Fvb2:21564226-21564526", "Fvb4:12491999-12492299",
          "Fvb4:10031391-10031691", "Fvb4:11888804-11889104",
          "Fvb5:14254403-14254703", "Fvb7:14794611-14794911",
          "Fvb3:8060224-8060524", "Fvb7:14389475-14389775",
          "Fvb4:8351241-8351541", "Fvb4:13960725-13961025",
          "Fvb2:14780968-14781268", "Fvb1:21964364-21964664",
          "Fvb5:23286242-23286542", "Fvb3:5378421-5378721",
          "Fvb1:21042414-21042714", "Fvb5:22861209-22861509",
          "Fvb5:15331597-15331897", "Fvb7:3913103-3913403",
          "Fvb5:1932831-1933131", "Fvb5:18732230-18732530",
          "Fvb4:15514941-15515241", "Fvb4:11246212-11246512",
          "Fvb3:21764664-21764964", "Fvb3:20944070-20944370",
          "Fvb3:19442811-19443111", "Fvb1:15054934-15055234",
          "Fvb7:4402223-4402523", "Fvb4:8609099-8609399",
          "Fvb4:13489410-13489710", "Fvb4:10000806-10001106",
          "Fvb3:25401262-25401562", "Fvb1:16290293-16290593",
          "Fvb3:1619182-1619482", "Fvb2:17460561-17460861",
          "Fvb3:13248041-13248341", "Fvb1:21369279-21369579",
          "Fvb4:9964395-9964695", "Fvb3:32421218-32421518",
          "Fvb3:25345781-25346081", "Fvb4:15439896-15440196",
          "Fvb2:4735696-4735996", "Fvb7:656350-656650",
          "Fvb7:20562955-20563255", "Fvb7:18584192-18584492",
          "Fvb7:1724200-1724500", "Fvb7:1227000-1227300",
          "Fvb7:1153901-1154201", "Fvb7:10983417-10983717",
          "Fvb6:4082406-4082706", "Fvb6:29119220-29119520",
          "Fvb6:24061143-24061443", "Fvb6:23009657-23009957",
          "Fvb6:20014241-20014541", "Fvb6:16095676-16095976",
          "Fvb6:15983735-15984035", "Fvb6:12839817-12840117",
          "Fvb6:11994599-11994899", "Fvb5:8956528-8956828",
          "Fvb5:28364923-28365223", "Fvb5:25618981-25619281",
          "Fvb5:17052372-17052672", "Fvb4:9967244-9967544",
          "Fvb4:9531613-9531913", "Fvb4:8355685-8355985",
          "Fvb4:8254397-8254697", "Fvb4:8015808-8016108",
          "Fvb4:7979132-7979432", "Fvb4:6960239-6960539",
          "Fvb4:6136557-6136857", "Fvb4:30573502-30573802",
          "Fvb4:30439850-30440150", "Fvb4:29793746-29794046",
          "Fvb4:22387731-22388031", "Fvb4:20120100-20120400",
          "Fvb4:19461334-19461634", "Fvb4:15583715-15584015",
          "Fvb4:14493373-14493673", "Fvb4:12849624-12849924",
          "Fvb4:12670175-12670475", "Fvb4:12667159-12667459",
          "Fvb4:11774238-11774538", "Fvb4:1152474-1152774",
          "Fvb4:11422972-11423272", "Fvb4:10546056-10546356",
          "Fvb4:10058982-10059282", "Fvb3:34385246-34385546",
          "Fvb3:33809698-33809998", "Fvb3:32890425-32890725",
          "Fvb3:31473298-31473598", "Fvb3:28121673-28121973",
          "Fvb3:27247081-27247381", "Fvb3:26150093-26150393",
          "Fvb3:25464867-25465167", "Fvb3:25226785-25227085",
          "Fvb3:24283907-24284207", "Fvb3:2171619-2171919",
          "Fvb3:19804998-19805298", "Fvb3:19309465-19309765",
          "Fvb3:16341997-16342297", "Fvb3:11121615-11121915",
          "Fvb2:795832-796132", "Fvb2:6645043-6645343",
          "Fvb2:5919985-5920285", "Fvb2:5595410-5595710", "Fvb2:50249-50549",
          "Fvb2:2745258-2745558", "Fvb2:25333505-25333805",
          "Fvb2:17985102-17985402", "Fvb2:11440343-11440643",
          "Fvb1:23828427-23828727", "Fvb1:23735605-23735905",
          "Fvb1:23369929-23370229", "Fvb1:23032369-23032669",
          "Fvb1:20794083-20794383", "Fvb1:16932993-16933293",
          "Fvb1:16702185-16702485", "Fvb1:15625433-15625733",
          "Fvb1:11761792-11762092", "Fvb1:11692284-11692584",
          "Fvb6:39343686-39343986", "Fvb6:23472757-23473057",
          "Fvb5:773201-773501", "Fvb5:28118142-28118442",
          "Fvb3:2890623-2890923", "Fvb3:23372314-23372614",
          "Fvb4:13150111-13150411", "Fvb3:12613205-12613505",
          "Fvb6:11557327-11557627", "Fvb7:3563946-3564246",
          "Fvb6:23163468-23163768", "Fvb3:6615550-6615850",
          "Fvb3:28129933-28130233", "Fvb1:20931906-20932206",
          "Fvb6:33193011-33193311", "Fvb7:6831145-6831445",
          "Fvb6:3330825-3331125", "Fvb6:32005847-32006147",
          "Fvb4:11428945-11429245", "Fvb3:6856673-6856973",
          "Fvb3:32098341-32098641", "Fvb1:20782718-20783018",
          "Fvb7:3988589-3988889", "Fvb7:2632606-2632906",
          "Fvb4:25643895-25644195", "Fvb6:27912884-27913184",
          "Fvb2:25661847-25662147", "Fvb2:27937700-27938000",
          "Fvb7:3706485-3706785", "Fvb3:8494366-8494666",
          "Fvb3:37286410-37286710", "Fvb7:9507397-9507697",
          "Fvb7:7653054-7653354", "Fvb7:9676839-9677139",
          "Fvb6:37902500-37902800", "Fvb4:5951766-5952066",
          "Fvb3:25063707-25064007", "Fvb3:12743709-12744009",
          "Fvb7:23568133-23568433", "Fvb6:10647950-10648250",
          "Fvb7:4159125-4159425", "Fvb7:1330284-1330584",
          "Fvb6:20077689-20077989", "Fvb6:11732197-11732497",
          "Fvb4:27221026-27221326", "Fvb3:3383908-3384208",
          "Fvb3:32677931-32678231", "Fvb3:20932611-20932911",
          "Fvb3:11916786-11917086", "Fvb1:22763880-22764180",
          "Fvb6:16917819-16918119", "Fvb5:7949912-7950212",
          "Fvb5:12691300-12691600", "Fvb4:10704129-10704429",
          "Fvb3:7822997-7823297", "Fvb1:16091195-16091495",
          "Fvb6:18437979-18438279", "Fvb1:23649717-23650017",
          "Fvb7:15452524-15452824", "Fvb2:20648372-20648672",
          "Fvb1:9501309-9501609", "Fvb7:5352479-5352779",
          "Fvb6:2433783-2434083", "Fvb5:17285477-17285777",
          "Fvb4:18417772-18418072", "Fvb3:27556460-27556760",
          "Fvb1:1697453-1697753", "Fvb6:18720434-18720734",
          "Fvb3:14026627-14026927", "Fvb7:9547795-9548095",
          "Fvb7:5919201-5919501", "Fvb7:23469333-23469633",
          "Fvb7:19405672-19405972", "Fvb7:19345184-19345484",
          "Fvb6:5059200-5059500", "Fvb6:3764929-3765229",
          "Fvb6:35107879-35108179", "Fvb6:31506995-31507295",
          "Fvb6:26236545-26236845", "Fvb6:23746100-23746400",
          "Fvb6:22652818-22653118", "Fvb6:22621971-22622271",
          "Fvb6:18125511-18125811", "Fvb6:15179130-15179430",
          "Fvb6:15074887-15075187", "Fvb6:11826120-11826420",
          "Fvb5:7451202-7451502", "Fvb5:6336524-6336824",
          "Fvb5:24806701-24807001", "Fvb5:22224793-22225093",
          "Fvb5:21536480-21536780", "Fvb5:17536864-17537164",
          "Fvb5:16437586-16437886", "Fvb4:8378534-8378834",
          "Fvb4:7769154-7769454", "Fvb4:7342580-7342880",
          "Fvb4:6713657-6713957", "Fvb4:5155942-5156242",
          "Fvb4:25967535-25967835", "Fvb4:22803375-22803675",
          "Fvb4:13422041-13422341", "Fvb4:13056703-13057003",
          "Fvb4:12961774-12962074", "Fvb4:12932341-12932641",
          "Fvb4:11702662-11702962", "Fvb4:11651077-11651377",
          "Fvb4:10398034-10398334", "Fvb4:10249156-10249456",
          "Fvb3:8707389-8707689", "Fvb3:33763133-33763433",
          "Fvb3:32144882-32145182", "Fvb3:30019143-30019443",
          "Fvb3:29415584-29415884", "Fvb3:27888612-27888912",
          "Fvb3:27412002-27412302", "Fvb3:26431216-26431516",
          "Fvb3:2256031-2256331", "Fvb3:21722310-21722610",
          "Fvb3:21557178-21557478", "Fvb3:19771105-19771405",
          "Fvb3:14420197-14420497", "Fvb3:13545393-13545693",
          "Fvb2:7647152-7647452", "Fvb2:4370208-4370508",
          "Fvb2:2706954-2707254", "Fvb2:20782538-20782838",
          "Fvb2:19808109-19808409", "Fvb2:11209269-11209569",
          "Fvb2:10095192-10095492", "Fvb1:6317153-6317453",
          "Fvb1:23320899-23321199", "Fvb1:22649366-22649666",
          "Fvb1:22548100-22548400", "Fvb1:21329536-21329836",
          "Fvb1:20498850-20499150", "Fvb1:20325315-20325615",
          "Fvb1:20312222-20312522", "Fvb1:19872149-19872449",
          "Fvb1:17020842-17021142", "Fvb1:13972033-13972333",
          "Fvb1:12298751-12299051", "Fvb1:11726630-11726930",
          "Fvb1:10259082-10259382", "Fvb4:27271393-27271693",
          "Fvb7:12321214-12321514", "Fvb5:15702522-15702822",
          "Fvb4:8003966-8004266", "Fvb4:22428612-22428912",
          "Fvb3:26636431-26636731", "Fvb3:14087853-14088153",
          "Fvb2:18165953-18166253", "Fvb1:16887908-16888208",
          "Fvb2:12344982-12345282", "Fvb4:11764622-11764922",
          "Fvb4:7728030-7728330", "Fvb3:31775788-31776088",
          "Fvb7:14814442-14814742", "Fvb4:10950728-10951028",
          "Fvb3:21677356-21677656", "Fvb1:8880538-8880838",
          "Fvb1:20349557-20349857", "Fvb5:15325546-15325846",
          "Fvb7:10301909-10302209", "Fvb6:4067836-4068136",
          "Fvb5:22439456-22439756", "Fvb4:20298328-20298628",
          "Fvb4:10540298-10540598", "Fvb3:29614885-29615185",
          "Fvb3:16447721-16448021", "Fvb3:15286285-15286585",
          "Fvb5:1923515-1923815", "Fvb6:5296997-5297297",
          "Fvb4:22319040-22319340", "Fvb2:14869417-14869717",
          "Fvb7:3183711-3184011", "Fvb5:4358911-4359211",
          "Fvb4:30992424-30992724", "Fvb3:26245534-26245834",
          "Fvb1:7625347-7625647", "Fvb5:22524607-22524907",
          "Fvb5:17839105-17839405", "Fvb4:9398977-9399277",
          "Fvb4:12393561-12393861", "Fvb4:11747029-11747329",
          "Fvb3:2866390-2866690", "Fvb3:5931471-5931771",
          "Fvb3:24401792-24402092", "Fvb2:24778977-24779277",
          "Fvb6:36954267-36954567", "Fvb4:11013449-11013749",
          "Fvb2:2110431-2110731", "Fvb1:18939071-18939371",
          "Fvb5:17183051-17183351", "Fvb4:9898173-9898473",
          "Fvb4:29516997-29517297", "Fvb4:13264506-13264806",
          "Fvb4:12609891-12610191", "Fvb3:29893462-29893762",
          "Fvb3:26296488-26296788", "Fvb1:10167200-10167500",
          "Fvb6:36133545-36133845", "Fvb6:35029446-35029746",
          "Fvb6:24534640-24534940", "Fvb6:16422875-16423175",
          "Fvb4:9766035-9766335", "Fvb4:8822066-8822366",
          "Fvb4:30145650-30145950", "Fvb4:19089452-19089752",
          "Fvb3:17301163-17301463", "Fvb1:23533741-23534041",
          "Fvb5:8923944-8924244", "Fvb3:18790200-18790500",
          "Fvb2:15131558-15131858", "Fvb7:4087981-4088281",
          "Fvb5:5781079-5781379", "Fvb4:12836154-12836454",
          "Fvb3:7948958-7949258", "Fvb3:22429727-22430027",
          "Fvb4:10389163-10389463", "Fvb6:5502602-5502902",
          "Fvb5:2987339-2987639", "Fvb7:7381381-7381681",
          "Fvb7:2959000-2959300", "Fvb7:11828740-11829040",
          "Fvb7:11514893-11515193", "Fvb6:7581889-7582189",
          "Fvb6:35945344-35945644", "Fvb6:22315762-22316062",
          "Fvb6:20576786-20577086", "Fvb6:1941760-1942060",
          "Fvb6:19058785-19059085", "Fvb6:18943086-18943386",
          "Fvb6:18914624-18914924", "Fvb6:18014098-18014398",
          "Fvb6:17061027-17061327", "Fvb6:15079625-15079925",
          "Fvb6:13770146-13770446", "Fvb5:27660442-27660742",
          "Fvb5:26110398-26110698", "Fvb5:25149373-25149673",
          "Fvb5:22916821-22917121", "Fvb5:22179184-22179484",
          "Fvb5:20874736-20875036", "Fvb5:1837613-1837913",
          "Fvb5:16158782-16159082", "Fvb4:9918597-9918897",
          "Fvb4:9683941-9684241", "Fvb4:9043584-9043884",
          "Fvb4:8636537-8636837", "Fvb4:8633965-8634265",
          "Fvb4:8370139-8370439", "Fvb4:6072395-6072695",
          "Fvb4:30097466-30097766", "Fvb4:26348075-26348375",
          "Fvb4:22668225-22668525", "Fvb4:19382642-19382942",
          "Fvb4:19013673-19013973", "Fvb4:18867730-18868030",
          "Fvb4:1818750-1819050", "Fvb4:17755938-17756238",
          "Fvb4:17496797-17497097", "Fvb4:16266056-16266356",
          "Fvb4:13704464-13704764", "Fvb4:13409691-13409991",
          "Fvb4:12774902-12775202", "Fvb4:11113739-11114039",
          "Fvb4:10931059-10931359", "Fvb4:10732417-10732717",
          "Fvb3:30802262-30802562", "Fvb3:27036076-27036376",
          "Fvb3:26542922-26543222", "Fvb3:26370179-26370479",
          "Fvb3:26043654-26043954", "Fvb3:25765041-25765341",
          "Fvb3:2489343-2489643", "Fvb3:24343678-24343978",
          "Fvb3:23291115-23291415", "Fvb3:18376647-18376947",
          "Fvb3:13664433-13664733", "Fvb3:13624119-13624419",
          "Fvb2:6479479-6479779", "Fvb2:24294019-24294319",
          "Fvb2:24206211-24206511", "Fvb2:17932130-17932430",
          "Fvb2:16344361-16344661", "Fvb2:149472-149772",
          "Fvb2:12232229-12232529", "Fvb2:11505830-11506130",
          "Fvb1:4289249-4289549", "Fvb1:23336364-23336664",
          "Fvb1:23202148-23202448", "Fvb1:22793823-22794123",
          "Fvb1:22452931-22453231", "Fvb1:21894841-21895141",
          "Fvb1:21644513-21644813", "Fvb1:21593437-21593737",
          "Fvb1:21295650-21295950", "Fvb1:21110451-21110751",
          "Fvb1:20806449-20806749", "Fvb1:20521011-20521311",
          "Fvb1:19602643-19602943", "Fvb1:19332929-19333229",
          "Fvb1:18169247-18169547", "Fvb1:14854334-14854634",
          "Fvb1:1370467-1370767", "Fvb4:8597694-8597994",
          "Fvb4:8426443-8426743", "Fvb3:6437733-6438033",
          "Fvb3:24766311-24766611", "Fvb1:23522691-23522991",
          "Fvb1:16472390-16472690", "Fvb2:18759898-18760198",
          "Fvb2:16581146-16581446", "Fvb4:13139317-13139617",
          "Fvb6:3844538-3844838", "Fvb6:21808143-21808443",
          "Fvb4:13062890-13063190", "Fvb7:14467585-14467885",
          "Fvb6:26473010-26473310", "Fvb6:39551292-39551592",
          "Fvb5:9965977-9966277", "Fvb5:9781161-9781461",
          "Fvb5:852951-853251", "Fvb5:22463780-22464080",
          "Fvb4:4904757-4905057", "Fvb4:14105489-14105789",
          "Fvb4:12057531-12057831", "Fvb2:25864108-25864408",
          "Fvb2:15351324-15351624", "Fvb1:14858986-14859286",
          "Fvb1:12506119-12506419", "Fvb7:1492521-1492821",
          "Fvb4:9133511-9133811", "Fvb7:10018653-10018953",
          "Fvb4:9279400-9279700", "Fvb3:23073968-23074268",
          "Fvb2:26840829-26841129", "Fvb1:7469484-7469784",
          "Fvb3:26132026-26132326", "Fvb4:7211619-7211919",
          "Fvb1:21993768-21994068", "Fvb4:31691357-31691657",
          "Fvb5:25782824-25783124", "Fvb4:32050824-32051124",
          "Fvb5:23348414-23348714", "Fvb5:11352558-11352858",
          "Fvb3:3318964-3319264", "Fvb2:17126230-17126530",
          "Fvb1:23418276-23418576", "Fvb6:29958739-29959039",
          "Fvb4:23844415-23844715", "Fvb7:15956965-15957265",
          "Fvb4:324463-324763", "Fvb3:26624985-26625285",
          "Fvb7:5493971-5494271", "Fvb7:11357492-11357792",
          "Fvb6:24832019-24832319", "Fvb5:17309075-17309375",
          "Fvb1:6650976-6651276", "Fvb1:14056479-14056779",
          "Fvb3:8267728-8268028", "Fvb6:33374547-33374847",
          "Fvb5:9501831-9502131", "Fvb4:8642634-8642934",
          "Fvb3:12195772-12196072", "Fvb7:11342942-11343242",
          "Fvb5:4856057-4856357", "Fvb5:21874550-21874850",
          "Fvb4:26825496-26825796", "Fvb3:3667388-3667688",
          "Fvb3:23416367-23416667", "Fvb2:9664958-9665258",
          "Fvb2:22605989-22606289", "Fvb6:18172571-18172871",
          "Fvb1:7999087-7999387", "Fvb4:4445126-4445426",
          "Fvb5:15686973-15687273", "Fvb4:2681743-2682043",
          "Fvb1:17877941-17878241", "Fvb5:26902828-26903128",
          "Fvb7:5503274-5503574", "Fvb4:16870417-16870717",
          "Fvb3:31985199-31985499", "Fvb5:3780147-3780447",
          "Fvb5:15092039-15092339", "Fvb1:22510006-22510306",
          "Fvb7:8024919-8025219", "Fvb7:14390139-14390439",
          "Fvb6:11998725-11999025", "Fvb5:27808532-27808832",
          "Fvb4:3441015-3441315", "Fvb4:20238010-20238310",
          "Fvb3:4623326-4623626", "Fvb3:17479875-17480175",
          "Fvb1:1516462-1516762", "Fvb1:23505016-23505316",
          "Fvb7:17073060-17073360", "Fvb7:9805529-9805829",
          "Fvb7:8478923-8479223", "Fvb7:6168904-6169204",
          "Fvb7:4153159-4153459", "Fvb7:14054954-14055254",
          "Fvb7:13790954-13791254", "Fvb7:12841128-12841428",
          "Fvb6:9657584-9657884", "Fvb6:6503694-6503994",
          "Fvb6:4020487-4020787", "Fvb6:28532894-28533194",
          "Fvb6:23236119-23236419", "Fvb6:21908979-21909279",
          "Fvb6:20022241-20022541", "Fvb6:19371601-19371901",
          "Fvb6:1760055-1760355", "Fvb6:14987864-14988164",
          "Fvb6:11908102-11908402", "Fvb5:8519777-8520077",
          "Fvb5:6301707-6302007", "Fvb5:4048170-4048470",
          "Fvb5:3076945-3077245", "Fvb5:27623659-27623959",
          "Fvb5:27080868-27081168", "Fvb5:24951227-24951527",
          "Fvb5:24571920-24572220", "Fvb5:23063331-23063631",
          "Fvb5:14352763-14353063", "Fvb5:1300871-1301171",
          "Fvb4:9614665-9614965", "Fvb4:9442065-9442365",
          "Fvb4:9245052-9245352", "Fvb4:9232496-9232796",
          "Fvb4:8618642-8618942", "Fvb4:7240712-7241012",
          "Fvb4:6363841-6364141", "Fvb4:5950292-5950592",
          "Fvb4:33805628-33805928", "Fvb4:30279403-30279703",
          "Fvb4:26252954-26253254", "Fvb4:23219537-23219837",
          "Fvb4:1915541-1915841", "Fvb4:19151692-19151992",
          "Fvb4:18098369-18098669", "Fvb4:15773104-15773404",
          "Fvb4:1476418-1476718", "Fvb4:12546054-12546354",
          "Fvb4:11661897-11662197", "Fvb3:7157388-7157688",
          "Fvb3:38006461-38006761", "Fvb3:3754003-3754303",
          "Fvb3:34626936-34627236", "Fvb3:33880482-33880782",
          "Fvb3:31343058-31343358", "Fvb3:29879221-29879521",
          "Fvb3:2758033-2758333", "Fvb3:25368539-25368839",
          "Fvb3:24971599-24971899", "Fvb3:23039411-23039711",
          "Fvb3:22365941-22366241", "Fvb3:21377458-21377758",
          "Fvb3:21065100-21065400", "Fvb3:18627176-18627476",
          "Fvb2:8271476-8271776", "Fvb2:8195206-8195506",
          "Fvb2:7962001-7962301", "Fvb2:2882845-2883145",
          "Fvb2:2375113-2375413", "Fvb2:16970076-16970376",
          "Fvb2:1360869-1361169", "Fvb2:13553494-13553794",
          "Fvb2:10873702-10874002", "Fvb1:9924512-9924812",
          "Fvb1:22957454-22957754", "Fvb1:22288612-22288912",
          "Fvb1:21794459-21794759", "Fvb1:20561997-20562297",
          "Fvb1:18931608-18931908", "Fvb1:18157733-18158033",
          "Fvb1:17803284-17803584", "Fvb1:1691386-1691686",
          "Fvb4:30479026-30479326", "Fvb7:2672387-2672687",
          "Fvb6:36952971-36953271", "Fvb4:11663089-11663389",
          "Fvb3:6668533-6668833", "Fvb3:33933478-33933778",
          "Fvb3:26358766-26359066", "Fvb3:25339127-25339427",
          "Fvb1:6055945-6056245", "Fvb1:20059718-20060018",
          "Fvb2:9474469-9474769", "Fvb5:24239941-24240241",
          "Fvb2:18532406-18532706", "Fvb1:23301243-23301543",
          "Fvb2:21063335-21063635", "Fvb6:21905260-21905560",
          "Fvb3:27312318-27312618", "Fvb2:8889659-8889959",
          "Fvb2:5282365-5282665", "Fvb2:22120515-22120815",
          "Fvb4:1895917-1896217", "Fvb6:25661805-25662105",
          "Fvb4:24649584-24649884", "Fvb6:13958552-13958852",
          "Fvb4:22679348-22679648", "Fvb3:22376160-22376460",
          "Fvb4:2416007-2416307", "Fvb3:25210406-25210706"
        ],
        "motifs": [
          {
            "db": 0,
            "id": "CSTGYGGGGCCCACY",
            "alt": "MEME-1",
            "consensus": "CSTGYGGGGCCCACY",
            "len": 15,
            "motif_evalue": "1.8e-3139",
            "motif_nsites": 2840,
            "n_tested": 142,
            "score_threshold": 5,
            "pwm": [
              [0.0869787, 0.639422, 0.149299, 0.124301], 
              [0.175004, 0.269012, 0.404219, 0.151765], 
              [0.0845138, 0.225704, 0.102469, 0.587313], 
              [0.0852178, 0.0214861, 0.85702, 0.0362765], 
              [0.0324026, 0.425345, 0.021838, 0.520414], 
              [0.0158542, 7.81663e-06, 0.984128, 9.78839e-06], 
              [9.78839e-06, 7.81663e-06, 0.999973, 9.78839e-06], 
              [0.00317868, 7.81663e-06, 0.996804, 9.78839e-06], 
              [0.134864, 0.0563438, 0.678505, 0.130287], 
              [0.255283, 0.607732, 0.00388068, 0.133104], 
              [9.78839e-06, 0.999973, 7.81663e-06, 9.78839e-06], 
              [9.78839e-06, 0.98448, 7.81663e-06, 0.0155022], 
              [0.940822, 0.0151483, 0.0440203, 9.78839e-06], 
              [0.00212271, 0.902441, 0.0359216, 0.0595147], 
              [0.0971894, 0.524637, 0.0485981, 0.329575]
            ],
            "total_sites": 2930,
            "sites": [
              0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
              3, 0, 0, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
              0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 2, 0, 1,
              0, 2, 0, 0, 0, 0, 0, 1, 0, 1, 0, 2, 2, 1, 1.5, 2, 1, 2, 2, 2, 3,
              1.33333, 1, 1, 0, 1, 3, 1, 1, 1, 3, 3, 5, 1, 1, 3, 3, 4, 0, 3,
              1, 1, 2, 1, 2, 0, 3, 5, 2, 5.5, 6, 3, 2, 4, 4, 5, 6, 4, 8.5, 9,
              7, 18.3333, 11, 21, 14, 12, 22, 23, 18, 34, 25, 43, 55, 52, 72,
              94, 100, 122.5, 141, 189.5, 201, 174.5, 187.5, 155, 165, 120,
              97, 81.5, 68, 53, 30, 36, 30, 38, 20, 22.5, 13.5, 11, 14, 13,
              10, 8, 8, 7, 8, 7, 9, 3, 6, 5, 0, 2, 6, 4, 3, 2, 4, 1, 2, 0, 2,
              3, 1, 3, 2, 2, 4, 1, 5, 1, 3, 1, 1, 0, 1, 0, 1, 1, 2, 1, 1, 1,
              3, 1, 1, 0, 2, 0, 1, 2, 2, 0, 0, 1, 1, 0, 0, 1, 2, 1, 0, 0, 1,
              1, 0, 2, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0,
              0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 1, 0, 1, 0, 0, 0, 0,
              1.33333, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1
            ],
            "seqs": [
              0, 2, 5, 7, 8, 9, 11, 12, 14, 15, 16, 17, 18, 19, 20, 23, 24,
              25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
              41, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
              58, 59, 60, 61, 62, 63, 64, 66, 67, 69, 70, 71, 72, 73, 74, 75,
              76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 87, 88, 89, 90, 92, 93,
              94, 95, 96, 97, 99, 100, 101, 102, 104, 105, 106, 108, 109, 110,
              111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
              125, 126, 127, 128, 129, 130, 132, 135, 136, 137, 138, 139, 140,
              141, 142, 144, 145, 146, 147, 148, 149, 150, 151, 152, 154, 156,
              157, 158, 159, 160, 161, 162, 163, 164, 165, 167, 168, 169, 170,
              171, 172, 174, 175, 176, 177, 179, 180, 181, 182, 183, 184, 185,
              186, 187, 188, 189, 191, 192, 193, 195, 197, 198, 199, 200, 201,
              202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 213, 214, 215,
              216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228,
              229, 230, 231, 232, 233, 234, 235, 237, 238, 239, 240, 241, 242,
              244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256,
              257, 258, 260, 261, 262, 263, 264, 267, 268, 270, 271, 273, 275,
              276, 277, 278, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290,
              291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303,
              304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316,
              317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329,
              330, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343,
              344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 357,
              358, 359, 360, 361, 363, 364, 365, 366, 368, 369, 370, 371, 372,
              373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385,
              386, 387, 388, 389, 390, 391, 393, 395, 396, 397, 398, 399, 401,
              402, 403, 404, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415,
              416, 417, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429,
              430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442,
              443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455,
              456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468,
              470, 471, 472, 473, 475, 476, 477, 478, 480, 481, 482, 483, 484,
              486, 487, 488, 489, 490, 492, 493, 494, 495, 496, 499, 500, 503,
              504, 505, 506, 507, 509, 510, 511, 513, 514, 515, 516, 517, 518,
              521, 522, 523, 524, 525, 527, 528, 529, 530, 531, 532, 533, 534,
              536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548,
              549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561,
              562, 563, 564, 565, 567, 568, 569, 570, 572, 573, 574, 575, 576,
              577, 578, 579, 580, 581, 582, 584, 585, 586, 587, 588, 589, 590,
              591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603,
              605, 606, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 619,
              622, 623, 624, 625, 626, 627, 628, 629, 630, 632, 633, 634, 635,
              636, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 649, 651,
              652, 653, 654, 655, 656, 658, 659, 660, 661, 662, 663, 664, 665,
              666, 667, 669, 671, 672, 673, 674, 675, 676, 677, 679, 680, 681,
              683, 684, 685, 686, 687, 688, 689, 690, 692, 693, 694, 696, 697,
              698, 699, 700, 701, 702, 703, 704, 705, 706, 708, 710, 711, 712,
              713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 724, 725, 726,
              727, 729, 730, 731, 733, 734, 735, 736, 737, 738, 739, 740, 741,
              742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 754, 755,
              756, 757, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769,
              770, 771, 772, 775, 776, 777, 778, 779, 780, 781, 782, 783, 785,
              786, 787, 788, 790, 792, 793, 794, 796, 797, 798, 799, 800, 802,
              803, 804, 805, 806, 807, 809, 810, 811, 812, 813, 814, 815, 816,
              817, 818, 819, 821, 822, 823, 824, 826, 827, 828, 829, 830, 831,
              832, 833, 834, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845,
              846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858,
              859, 860, 861, 862, 863, 864, 865, 867, 868, 869, 871, 872, 873,
              874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886,
              887, 888, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900,
              901, 902, 903, 904, 905, 906, 907, 909, 910, 911, 912, 913, 914,
              915, 916, 917, 919, 920, 921, 922, 923, 925, 926, 927, 929, 930,
              932, 933, 935, 936, 937, 938, 940, 941, 942, 944, 945, 946, 947,
              948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960,
              961, 962, 963, 964, 965, 966, 967, 968, 971, 972, 973, 974, 975,
              976, 977, 978, 979, 980, 981, 983, 984, 985, 986, 987, 988, 989,
              990, 991, 992, 993, 994, 995, 996, 997, 998, 1000, 1001, 1003,
              1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013,
              1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023,
              1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033,
              1034, 1035, 1036, 1040, 1041, 1042, 1043, 1045, 1046, 1047,
              1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057,
              1058, 1059, 1060, 1061, 1062, 1064, 1065, 1066, 1067, 1068,
              1070, 1071, 1072, 1073, 1075, 1077, 1078, 1079, 1080, 1081,
              1083, 1084, 1085, 1086, 1088, 1089, 1090, 1091, 1092, 1093,
              1094, 1095, 1096, 1099, 1102, 1103, 1105, 1107, 1108, 1109,
              1110, 1111, 1112, 1113, 1114, 1115, 1117, 1118, 1119, 1120,
              1121, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131,
              1132, 1133, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142,
              1144, 1146, 1147, 1148, 1149, 1150, 1152, 1153, 1154, 1155,
              1156, 1157, 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1165,
              1166, 1167, 1168, 1169, 1171, 1172, 1173, 1174, 1175, 1176,
              1177, 1178, 1179, 1180, 1181, 1182, 1183, 1184, 1185, 1186,
              1187, 1188, 1189, 1190, 1191, 1192, 1193, 1194, 1196, 1198,
              1200, 1201, 1202, 1203, 1205, 1208, 1209, 1210, 1211, 1212,
              1213, 1214, 1215, 1216, 1217, 1218, 1219, 1221, 1222, 1223,
              1224, 1225, 1227, 1228, 1229, 1230, 1231, 1232, 1233, 1237,
              1238, 1239, 1241, 1242, 1244, 1245, 1246, 1247, 1250, 1252,
              1254, 1255, 1259, 1260, 1261, 1263, 1264, 1265, 1266, 1268,
              1270, 1272, 1273, 1274, 1275, 1276, 1278, 1279, 1280, 1281,
              1282, 1283, 1284, 1285, 1286, 1287, 1288, 1289, 1290, 1291,
              1292, 1293, 1294, 1295, 1296, 1297, 1298, 1299, 1300, 1302,
              1303, 1304, 1305, 1306, 1308, 1309, 1310, 1311, 1312, 1313,
              1314, 1316, 1317, 1318, 1319, 1320, 1324, 1325, 1326, 1328,
              1329, 1330, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339,
              1340, 1342, 1343, 1344, 1345, 1346, 1348, 1349, 1350, 1351,
              1353, 1354, 1355, 1356, 1357, 1358, 1359, 1360, 1361, 1362,
              1364, 1365, 1366, 1370, 1371, 1372, 1373, 1374, 1375, 1376,
              1377, 1379, 1380, 1381, 1382, 1383, 1384, 1385, 1387, 1388,
              1389, 1390, 1391, 1392, 1393, 1394, 1395, 1396, 1397, 1399,
              1400, 1401, 1403, 1404, 1405, 1406, 1407, 1408, 1410, 1412,
              1413, 1415, 1416, 1417, 1418, 1419, 1420, 1421, 1422, 1423,
              1424, 1425, 1427, 1428, 1429, 1430, 1432, 1433, 1435, 1436,
              1437, 1438, 1439, 1440, 1441, 1442, 1443, 1444, 1445, 1446,
              1447, 1449, 1450, 1451, 1452, 1453, 1454, 1455, 1456, 1457,
              1458, 1459, 1460, 1461, 1462, 1463, 1464, 1465, 1467, 1468,
              1469, 1470, 1471, 1472, 1473, 1474, 1475, 1478, 1480, 1481,
              1482, 1483, 1485, 1486, 1487, 1488, 1489, 1490, 1491, 1492,
              1493, 1494, 1495, 1496, 1497, 1498, 1499, 1500, 1501, 1502,
              1503, 1505, 1506, 1507, 1508, 1509, 1511, 1512, 1514, 1515,
              1516, 1517, 1518, 1521, 1522, 1523, 1524, 1525, 1526, 1527,
              1528, 1529, 1530, 1531, 1532, 1533, 1534, 1535, 1536, 1537,
              1538, 1539, 1540, 1542, 1543, 1545, 1546, 1547, 1548, 1549,
              1550, 1551, 1552, 1553, 1554, 1555, 1556, 1557, 1558, 1559,
              1560, 1561, 1563, 1564, 1565, 1566, 1567, 1568, 1569, 1570,
              1571, 1572, 1573, 1574, 1575, 1576, 1577, 1578, 1579, 1581,
              1582, 1586, 1589, 1590, 1591, 1592, 1593, 1594, 1595, 1596,
              1597, 1598, 1599, 1600, 1601, 1602, 1603, 1604, 1605, 1608,
              1609, 1610, 1611, 1612, 1614, 1615, 1616, 1617, 1618, 1619,
              1620, 1622, 1623, 1625, 1626, 1627, 1628, 1629, 1630, 1631,
              1632, 1633, 1634, 1635, 1636, 1639, 1640, 1641, 1642, 1643,
              1644, 1645, 1646, 1648, 1649, 1650, 1652, 1654, 1655, 1656,
              1657, 1658, 1659, 1660, 1661, 1662, 1663, 1664, 1665, 1666,
              1668, 1669, 1670, 1671, 1672, 1674, 1675, 1676, 1677, 1681,
              1683, 1685, 1686, 1687, 1688, 1690, 1691, 1692, 1693, 1694,
              1696, 1698, 1699, 1702, 1703, 1704, 1705, 1707, 1708, 1709,
              1710, 1712, 1713, 1714, 1716, 1717, 1718, 1719, 1722, 1724,
              1725, 1726, 1727, 1730, 1731, 1732, 1733, 1735, 1736, 1737,
              1738, 1740, 1741, 1742, 1743, 1746, 1747, 1748, 1749, 1752,
              1753, 1756, 1757, 1758, 1761, 1762, 1763, 1764, 1765, 1766,
              1768, 1770, 1772, 1773, 1774, 1776, 1777, 1778, 1779, 1780,
              1781, 1782, 1783, 1784, 1785, 1786, 1788, 1789, 1790, 1791,
              1792, 1793, 1794, 1795, 1796, 1797, 1798, 1799, 1800, 1801,
              1802, 1804, 1805, 1806, 1807, 1808, 1809, 1810, 1811, 1812,
              1813, 1814, 1815, 1817, 1818, 1819, 1820, 1821, 1822, 1823,
              1824, 1825, 1826, 1827, 1828, 1829, 1832, 1833, 1835, 1836,
              1837, 1838, 1840, 1841, 1842, 1843, 1844, 1845, 1846, 1849,
              1850, 1852, 1854, 1857, 1858, 1859, 1861, 1862, 1863, 1864,
              1867, 1868, 1870, 1871, 1872, 1873, 1874, 1875, 1876, 1877,
              1878, 1879, 1882, 1883, 1884, 1887, 1888, 1890, 1892, 1894,
              1895, 1896, 1897, 1898, 1900, 1901, 1902, 1903, 1906, 1907,
              1909, 1910, 1912, 1913, 1914, 1915, 1916, 1917, 1919, 1920,
              1922, 1923, 1924, 1925, 1926, 1927, 1929, 1930, 1931, 1932,
              1933, 1934, 1935, 1936, 1937, 1938, 1939, 1940, 1942, 1944,
              1945, 1947, 1948, 1949, 1950, 1952, 1953, 1954, 1957, 1958,
              1960, 1962, 1963, 1964, 1966, 1968, 1970, 1971, 1972, 1973,
              1974, 1975, 1976, 1979, 1980, 1981, 1982, 1985, 1987, 1988,
              1989, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 2000, 2001,
              2002, 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2013, 2014,
              2015, 2016, 2018, 2020, 2021, 2022, 2023, 2024, 2026, 2027,
              2028, 2029, 2030, 2031, 2032, 2033, 2034, 2035, 2036, 2037,
              2039, 2040, 2042, 2045, 2046, 2047, 2048, 2049, 2050, 2051,
              2052, 2053, 2054, 2055, 2056, 2058, 2059, 2060, 2061, 2062,
              2063, 2065, 2066, 2067, 2068, 2069, 2070, 2071, 2072, 2073,
              2074, 2075, 2076, 2077, 2078, 2079, 2080, 2081, 2082, 2083,
              2084, 2085, 2086, 2087, 2088, 2089, 2090, 2093, 2094, 2096,
              2097, 2098, 2099, 2100, 2101, 2104, 2105, 2106, 2107, 2108,
              2109, 2110, 2112, 2113, 2114, 2115, 2116, 2117, 2118, 2120,
              2121, 2124, 2125, 2130, 2131, 2132, 2133, 2135, 2136, 2138,
              2140, 2141, 2142, 2143, 2147, 2148, 2149, 2150, 2152, 2154,
              2156, 2157, 2158, 2159, 2160, 2161, 2162, 2163, 2164, 2165,
              2166, 2167, 2168, 2169, 2171, 2173, 2174, 2175, 2178, 2179,
              2181, 2182, 2183, 2184, 2185, 2186, 2187, 2188, 2189, 2190,
              2191, 2192, 2193, 2194, 2195, 2196, 2198, 2200, 2201, 2202,
              2203, 2204, 2205, 2206, 2207, 2209, 2210, 2211, 2213, 2214,
              2215, 2217, 2218, 2219, 2221, 2222, 2223, 2224, 2225, 2226,
              2227, 2228, 2229, 2231, 2232, 2233, 2234, 2235, 2236, 2237,
              2238, 2239, 2241, 2242, 2243, 2245, 2246, 2247, 2249, 2252,
              2254, 2255, 2257, 2258, 2260, 2261, 2264, 2266, 2268, 2269,
              2270, 2271, 2272, 2273, 2275, 2276, 2277, 2279, 2280, 2281,
              2282, 2283, 2284, 2285, 2287, 2288, 2289, 2290, 2292, 2293,
              2294, 2296, 2297, 2298, 2300, 2303, 2305, 2306, 2307, 2308,
              2309, 2313, 2314, 2315, 2316, 2318, 2319, 2320, 2322, 2324,
              2325, 2326, 2327, 2329, 2330, 2331, 2332, 2333, 2336, 2338,
              2339, 2340, 2341, 2342, 2343, 2344, 2345, 2348, 2349, 2350,
              2351, 2352, 2354, 2356, 2358, 2359, 2360, 2362, 2363, 2364,
              2365, 2366, 2367, 2368, 2370, 2372, 2373, 2375, 2376, 2377,
              2378, 2379, 2381, 2383, 2384, 2386, 2387, 2388, 2389, 2390,
              2391, 2392, 2393, 2394, 2395, 2396, 2397, 2398, 2399, 2401,
              2402, 2403, 2404, 2405, 2406, 2407, 2408, 2411, 2412, 2413,
              2414, 2415, 2417, 2418, 2419, 2421, 2423, 2424, 2426, 2427,
              2428, 2429, 2431, 2432, 2433, 2435, 2436, 2437, 2438, 2439,
              2441, 2442, 2443, 2445, 2446, 2447, 2448, 2449, 2450, 2452,
              2453, 2454, 2456, 2459, 2461, 2463, 2464, 2466, 2467, 2468,
              2469, 2470, 2471, 2473, 2474, 2475, 2476, 2480, 2481, 2482,
              2483, 2484, 2486, 2489, 2491, 2494, 2495, 2496, 2497, 2498,
              2499, 2500, 2502, 2503, 2504, 2506, 2507, 2508, 2511, 2512,
              2513, 2514, 2515, 2516, 2517, 2518, 2520, 2521, 2522, 2523,
              2524, 2525, 2526, 2527, 2528, 2529, 2530, 2531, 2532, 2533,
              2535, 2537, 2538, 2540, 2541, 2542, 2543, 2545, 2546, 2547,
              2548, 2549, 2550, 2551, 2552, 2553, 2554, 2555, 2556, 2557,
              2558, 2559, 2560, 2561, 2562, 2563, 2565, 2567, 2568, 2570,
              2571, 2572, 2573, 2577, 2578, 2579, 2580, 2581, 2583, 2584,
              2585, 2586, 2587, 2589, 2591, 2592, 2593, 2596, 2597, 2599,
              2603, 2604, 2605, 2606, 2607, 2608, 2609, 2611, 2613, 2615,
              2616, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625,
              2626, 2629, 2630, 2631, 2632, 2633, 2636, 2637, 2638, 2639,
              2641, 2643, 2644, 2646, 2647, 2648, 2649, 2650, 2653, 2654,
              2656, 2657, 2658, 2660, 2661, 2662, 2667, 2669, 2670, 2671,
              2672, 2675, 2676, 2677, 2678, 2679, 2680, 2681, 2683, 2686,
              2687, 2689, 2690, 2692, 2693, 2695, 2696, 2697, 2699, 2700,
              2701, 2702, 2703, 2706, 2707, 2708, 2710, 2711, 2714, 2715,
              2716, 2717, 2719, 2720, 2722, 2724, 2725, 2726, 2728, 2729,
              2730, 2731, 2735, 2736, 2737, 2738, 2742, 2743, 2746, 2747,
              2749, 2751, 2752, 2754, 2755, 2757, 2758, 2760, 2762, 2763,
              2764, 2765, 2766, 2768, 2769, 2770, 2772, 2774, 2775, 2777,
              2780, 2782, 2786, 2787, 2790, 2791, 2792, 2793, 2794, 2796,
              2798, 2799, 2800, 2801, 2803, 2805, 2808, 2810, 2811, 2814,
              2815, 2816, 2817, 2819, 2820, 2821, 2822, 2823, 2825, 2826,
              2827, 2828, 2832, 2833, 2834, 2835, 2836, 2837, 2838, 2839,
              2840, 2841, 2842, 2843, 2844, 2845, 2846, 2847, 2848, 2850,
              2851, 2852, 2853, 2855, 2857, 2859, 2860, 2861, 2863, 2865,
              2867, 2868, 2869, 2871, 2872, 2873, 2874, 2875, 2877, 2879,
              2880, 2881, 2882, 2883, 2885, 2886, 2887, 2889, 2891, 2892,
              2893, 2894, 2897, 2898, 2899, 2900, 2901, 2902, 2903, 2904,
              2905, 2906, 2907, 2909, 2910, 2911, 2913, 2917, 2919, 2920,
              2921, 2922, 2923, 2924, 2925, 2927, 2929, 2930, 2931, 2933,
              2934, 2935, 2936, 2938, 2939, 2941, 2942, 2943, 2947, 2949,
              2950, 2951, 2954, 2955, 2958, 2959, 2960, 2962, 2964, 2965,
              2969, 2970, 2972, 2973, 2975, 2976, 2980, 2981, 2982, 2985,
              2986, 2987, 2988, 2989, 2990, 2993, 2994, 2995, 2996, 2997,
              2998, 2999
            ],
            "peaks": [
              {
                "center": 0,
                "spread": 28,
                "sites": 2427.5,
                "log_adj_pvalue": -4349.02
              }
            ]
          }, {
            "db": 0,
            "id": "TGAAATTCGGGGTGG",
            "alt": "MEME-2",
            "consensus": "TGAAATTCGGGGTGG",
            "len": 15,
            "motif_evalue": "2.2e-1326",
            "motif_nsites": 987,
            "n_tested": 142,
            "score_threshold": 5,
            "pwm": [
              [0.0162375, 2.24901e-05, 0.167179, 0.816561], 
              [0.0689172, 2.24901e-05, 0.931032, 2.81633e-05], 
              [0.999927, 2.24901e-05, 2.24901e-05, 2.81633e-05], 
              [0.981692, 2.24901e-05, 0.0121793, 0.00610655], 
              [0.892542, 2.24901e-05, 0.093225, 0.0142107], 
              [0.00104106, 0.00711377, 2.24901e-05, 0.991823], 
              [2.81633e-05, 0.121591, 2.24901e-05, 0.878358], 
              [2.81633e-05, 0.786164, 0.00610087, 0.207707], 
              [0.090191, 0.00103539, 0.904693, 0.00408075], 
              [0.060812, 2.24901e-05, 0.914824, 0.0243417], 
              [0.0344727, 2.24901e-05, 0.965477, 2.81633e-05], 
              [0.070943, 2.24901e-05, 0.923941, 0.00509365], 
              [0.00408075, 0.0263618, 2.24901e-05, 0.969535], 
              [0.123623, 2.24901e-05, 0.876327, 2.81633e-05], 
              [0.0527078, 0.00204828, 0.945216, 2.81633e-05]
            ],
            "total_sites": 1239,
            "sites": [
              0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 0, 0.5, 0, 0, 0, 0, 0,
              0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
              0, 0.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0,
              0, 0, 2, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 2, 0, 1, 0, 1, 1,
              2, 0, 2, 3, 3, 6, 3, 4, 2, 4, 7, 5, 3, 8, 3, 6, 12, 13, 19, 16,
              16, 22, 22, 33, 26, 35, 27, 18, 22, 12, 17, 20, 12, 22, 6, 8, 5,
              10, 1, 4, 7, 5, 9, 13, 14, 10, 14, 3, 5, 6, 6, 4, 2, 4, 0, 1, 2,
              2, 3, 4, 3, 4, 0, 3, 4, 2, 4, 2, 5, 6, 7, 2, 10, 10, 5, 13, 12,
              11, 16, 6, 10, 11, 9, 7, 13, 11, 16, 14, 12, 11, 13, 12, 26, 23,
              25, 29, 35, 34, 38, 18, 21, 20, 15, 7, 4, 7, 12, 5, 3, 4, 3, 5,
              4, 1, 3, 3, 1, 1, 1, 1, 4, 1, 2, 0, 1, 1, 3, 1, 0, 1, 2, 0, 1,
              1, 0, 2, 2, 0, 0, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
              0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
              0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0,
              0, 0, 0, 1, 0, 0
            ],
            "seqs": [
              14, 15, 20, 22, 23, 26, 28, 30, 39, 41, 53, 62, 69, 79, 82, 83,
              87, 90, 97, 101, 106, 115, 117, 124, 127, 138, 140, 142, 146,
              156, 163, 166, 167, 170, 174, 175, 179, 190, 191, 193, 199, 203,
              205, 209, 210, 216, 225, 228, 230, 233, 239, 242, 244, 246, 249,
              250, 254, 276, 278, 281, 282, 284, 289, 290, 295, 300, 301, 315,
              316, 318, 321, 322, 330, 331, 336, 338, 341, 343, 345, 347, 352,
              353, 357, 361, 371, 374, 375, 383, 384, 385, 387, 390, 393, 396,
              398, 399, 400, 401, 402, 406, 407, 408, 410, 413, 419, 420, 427,
              430, 433, 439, 448, 449, 451, 455, 468, 469, 473, 474, 479, 481,
              482, 486, 488, 490, 493, 494, 498, 499, 523, 536, 537, 539, 540,
              544, 558, 562, 563, 566, 568, 572, 574, 576, 577, 581, 585, 588,
              592, 593, 595, 596, 597, 598, 601, 606, 615, 616, 622, 624, 631,
              632, 633, 634, 635, 637, 639, 640, 641, 645, 646, 653, 655, 656,
              663, 664, 672, 674, 677, 680, 681, 686, 701, 703, 704, 705, 711,
              712, 714, 717, 719, 724, 726, 729, 734, 736, 737, 743, 750, 752,
              757, 762, 769, 771, 776, 779, 783, 789, 792, 800, 803, 807, 832,
              834, 841, 845, 846, 849, 850, 851, 852, 853, 854, 855, 859, 861,
              867, 874, 876, 881, 884, 885, 890, 893, 894, 897, 898, 900, 902,
              903, 904, 905, 906, 908, 909, 924, 925, 926, 927, 932, 933, 942,
              944, 946, 949, 953, 955, 958, 959, 960, 961, 965, 968, 969, 973,
              974, 975, 977, 983, 985, 988, 990, 992, 996, 1004, 1007, 1010,
              1012, 1020, 1022, 1023, 1024, 1025, 1027, 1029, 1041, 1043,
              1048, 1051, 1053, 1063, 1065, 1066, 1068, 1071, 1073, 1074,
              1076, 1077, 1078, 1079, 1080, 1084, 1088, 1089, 1091, 1092,
              1097, 1100, 1101, 1106, 1108, 1110, 1111, 1113, 1114, 1117,
              1119, 1120, 1121, 1122, 1123, 1124, 1125, 1127, 1130, 1131,
              1134, 1136, 1139, 1140, 1142, 1151, 1152, 1153, 1154, 1162,
              1167, 1172, 1174, 1177, 1180, 1182, 1193, 1194, 1196, 1203,
              1208, 1209, 1215, 1220, 1222, 1223, 1228, 1236, 1238, 1239,
              1243, 1244, 1245, 1251, 1255, 1258, 1263, 1266, 1268, 1270,
              1273, 1275, 1276, 1279, 1280, 1281, 1282, 1287, 1292, 1293,
              1297, 1298, 1302, 1303, 1305, 1306, 1309, 1311, 1316, 1324,
              1328, 1331, 1335, 1340, 1342, 1348, 1350, 1351, 1352, 1353,
              1354, 1355, 1356, 1357, 1358, 1359, 1360, 1361, 1362, 1363,
              1364, 1365, 1366, 1367, 1370, 1371, 1373, 1374, 1377, 1379,
              1380, 1383, 1386, 1389, 1390, 1392, 1393, 1397, 1401, 1403,
              1404, 1406, 1407, 1410, 1412, 1413, 1417, 1419, 1421, 1422,
              1423, 1425, 1429, 1430, 1432, 1442, 1443, 1444, 1445, 1447,
              1449, 1450, 1453, 1454, 1455, 1457, 1458, 1468, 1469, 1470,
              1471, 1472, 1480, 1481, 1482, 1483, 1485, 1488, 1489, 1495,
              1499, 1500, 1507, 1508, 1517, 1520, 1528, 1532, 1536, 1537,
              1542, 1547, 1554, 1555, 1556, 1558, 1564, 1566, 1567, 1569,
              1570, 1576, 1578, 1581, 1583, 1584, 1588, 1591, 1592, 1593,
              1594, 1595, 1596, 1597, 1598, 1599, 1600, 1601, 1605, 1606,
              1607, 1608, 1610, 1612, 1614, 1615, 1616, 1619, 1620, 1621,
              1622, 1623, 1629, 1630, 1633, 1635, 1639, 1640, 1643, 1644,
              1646, 1647, 1648, 1649, 1652, 1655, 1658, 1662, 1664, 1666,
              1670, 1671, 1677, 1680, 1683, 1688, 1689, 1691, 1693, 1703,
              1704, 1705, 1706, 1709, 1710, 1711, 1712, 1718, 1719, 1720,
              1721, 1722, 1723, 1725, 1730, 1731, 1733, 1735, 1736, 1737,
              1740, 1741, 1742, 1743, 1746, 1749, 1755, 1756, 1757, 1758,
              1759, 1762, 1765, 1766, 1768, 1770, 1778, 1781, 1784, 1789,
              1796, 1797, 1798, 1801, 1802, 1804, 1811, 1818, 1821, 1826,
              1830, 1837, 1839, 1841, 1842, 1843, 1844, 1845, 1846, 1849,
              1850, 1851, 1852, 1853, 1858, 1859, 1862, 1864, 1865, 1866,
              1867, 1868, 1871, 1872, 1873, 1876, 1884, 1888, 1894, 1895,
              1898, 1904, 1908, 1910, 1911, 1915, 1916, 1917, 1919, 1928,
              1929, 1930, 1933, 1934, 1935, 1938, 1939, 1940, 1941, 1945,
              1951, 1952, 1962, 1963, 1970, 1974, 1977, 1986, 1987, 1989,
              1996, 1997, 1999, 2000, 2001, 2004, 2005, 2006, 2008, 2010,
              2012, 2013, 2014, 2015, 2016, 2017, 2018, 2021, 2022, 2023,
              2024, 2025, 2028, 2029, 2030, 2031, 2032, 2033, 2034, 2036,
              2044, 2049, 2052, 2053, 2055, 2058, 2060, 2062, 2066, 2074,
              2077, 2078, 2080, 2081, 2082, 2086, 2089, 2090, 2092, 2093,
              2098, 2100, 2101, 2108, 2109, 2113, 2114, 2115, 2116, 2119,
              2123, 2124, 2125, 2126, 2127, 2129, 2131, 2135, 2136, 2137,
              2138, 2139, 2140, 2143, 2144, 2147, 2148, 2149, 2150, 2151,
              2152, 2153, 2154, 2160, 2161, 2162, 2163, 2164, 2165, 2167,
              2168, 2169, 2171, 2172, 2173, 2174, 2175, 2176, 2177, 2179,
              2180, 2181, 2182, 2183, 2185, 2187, 2188, 2190, 2195, 2196,
              2200, 2202, 2204, 2208, 2210, 2213, 2214, 2215, 2216, 2218,
              2221, 2222, 2223, 2224, 2227, 2229, 2233, 2235, 2236, 2238,
              2240, 2246, 2247, 2248, 2253, 2255, 2257, 2258, 2260, 2261,
              2262, 2263, 2265, 2266, 2268, 2270, 2272, 2273, 2277, 2282,
              2284, 2285, 2286, 2287, 2288, 2290, 2291, 2292, 2293, 2294,
              2295, 2299, 2300, 2303, 2305, 2306, 2307, 2308, 2309, 2311,
              2313, 2314, 2316, 2318, 2319, 2324, 2328, 2331, 2332, 2333,
              2334, 2335, 2338, 2339, 2344, 2345, 2348, 2353, 2354, 2359,
              2360, 2361, 2363, 2364, 2365, 2367, 2368, 2373, 2376, 2378,
              2383, 2384, 2385, 2389, 2390, 2391, 2392, 2401, 2403, 2404,
              2405, 2408, 2409, 2411, 2413, 2416, 2418, 2419, 2420, 2421,
              2423, 2425, 2426, 2430, 2434, 2435, 2436, 2437, 2438, 2439,
              2441, 2442, 2445, 2447, 2448, 2449, 2452, 2453, 2454, 2455,
              2456, 2457, 2458, 2459, 2465, 2466, 2467, 2468, 2469, 2470,
              2471, 2472, 2473, 2479, 2480, 2486, 2488, 2490, 2491, 2492,
              2495, 2497, 2502, 2503, 2504, 2506, 2507, 2509, 2511, 2512,
              2515, 2523, 2525, 2526, 2529, 2530, 2533, 2543, 2545, 2547,
              2550, 2559, 2568, 2569, 2572, 2573, 2575, 2577, 2579, 2581,
              2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 2593, 2594,
              2595, 2596, 2597, 2598, 2599, 2600, 2601, 2602, 2606, 2607,
              2611, 2612, 2613, 2618, 2622, 2624, 2625, 2626, 2627, 2628,
              2629, 2630, 2631, 2632, 2634, 2636, 2639, 2640, 2641, 2642,
              2643, 2647, 2648, 2649, 2651, 2652, 2657, 2658, 2661, 2662,
              2666, 2667, 2671, 2672, 2674, 2675, 2676, 2677, 2679, 2680,
              2683, 2687, 2689, 2690, 2696, 2699, 2700, 2703, 2706, 2707,
              2709, 2712, 2716, 2717, 2718, 2721, 2725, 2726, 2727, 2728,
              2729, 2730, 2731, 2732, 2733, 2734, 2735, 2737, 2738, 2741,
              2742, 2743, 2744, 2747, 2750, 2751, 2753, 2754, 2756, 2757,
              2758, 2759, 2760, 2761, 2762, 2763, 2764, 2765, 2766, 2767,
              2769, 2774, 2776, 2777, 2780, 2781, 2783, 2785, 2786, 2787,
              2788, 2790, 2792, 2793, 2794, 2796, 2797, 2799, 2800, 2802,
              2803, 2807, 2810, 2817, 2819, 2823, 2825, 2826, 2827, 2828,
              2832, 2833, 2834, 2836, 2842, 2844, 2847, 2849, 2850, 2851,
              2853, 2854, 2855, 2856, 2858, 2859, 2863, 2866, 2870, 2873,
              2876, 2886, 2891, 2898, 2899, 2900, 2901, 2902, 2903, 2905,
              2907, 2908, 2911, 2912, 2913, 2915, 2917, 2918, 2920, 2921,
              2923, 2925, 2926, 2927, 2932, 2933, 2934, 2935, 2936, 2937,
              2938, 2941, 2943, 2947, 2949, 2951, 2952, 2955, 2956, 2962,
              2964, 2965, 2967, 2968, 2969, 2970, 2971, 2975, 2976, 2979,
              2981, 2982, 2984, 2985, 2987, 2988, 2993, 2996, 2997, 2999
            ],
            "peaks": [
              {
                "center": 0,
                "spread": 108,
                "sites": 1165,
                "log_adj_pvalue": -887.409
              }
            ]
          }, {
            "db": 0,
            "id": "CCTGAAACCCGRAGTA",
            "alt": "MEME-3",
            "consensus": "CCTGAAACCCGRAGTA",
            "len": 16,
            "motif_evalue": "3.1e-1384",
            "motif_nsites": 933,
            "n_tested": 142,
            "score_threshold": 5,
            "pwm": [
              [0.00538822, 0.965622, 2.37917e-05, 0.0289657], 
              [0.0225354, 0.770573, 0.00538222, 0.201509], 
              [2.97932e-05, 0.00431033, 0.00323845, 0.99242], 
              [0.0814791, 0.00216756, 0.915253, 0.00110168], 
              [0.996708, 2.37917e-05, 0.00323845, 2.97932e-05], 
              [0.995636, 0.00431033, 2.37917e-05, 2.97932e-05], 
              [0.993492, 0.00216756, 2.37917e-05, 0.00431633], 
              [2.97932e-05, 0.857381, 2.37917e-05, 0.142566], 
              [0.00753199, 0.93883, 2.37917e-05, 0.053615], 
              [0.00860287, 0.916325, 2.37917e-05, 0.0750488], 
              [0.25295, 2.37917e-05, 0.740566, 0.0064601], 
              [0.451214, 0.00216756, 0.542303, 0.00431633], 
              [0.831667, 2.37917e-05, 0.16828, 2.97932e-05], 
              [0.141494, 0.00431033, 0.849879, 0.00431633], 
              [0.00538822, 0.00431033, 2.37917e-05, 0.990278], 
              [0.993492, 2.37917e-05, 0.0064541, 2.97932e-05]
            ],
            "total_sites": 1047,
            "sites": [
              0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
              0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
              0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
              0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0,
              1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 2, 1, 0, 0, 3, 2, 1, 3, 4, 3, 3,
              7, 3, 5, 5, 5, 7, 8, 6, 13, 3, 6, 14, 13, 21, 13, 17, 20, 24,
              32, 28, 36, 25, 16, 23, 11, 20, 19, 11, 20, 5, 7, 5, 10, 1, 7,
              5, 1, 5, 4, 5, 8, 1, 2, 8, 6, 7, 12, 11, 16, 11, 9, 11, 12, 14,
              24, 23, 26, 28, 35, 36, 40, 20, 23, 22, 15, 9, 4, 7, 11, 7, 5,
              4, 3, 6, 4, 2, 3, 3, 2, 1, 2, 3, 3, 2, 2, 1, 0, 1, 2, 1, 0, 0,
              1, 0, 1, 0, 1, 1, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 1,
              0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
              0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
              0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
              0, 1, 0, 0
            ],
            "seqs": [
              22, 82, 124, 127, 140, 146, 163, 179, 216, 230, 233, 242, 246,
              278, 289, 295, 300, 315, 318, 322, 330, 331, 336, 341, 345, 347,
              352, 353, 357, 371, 374, 375, 383, 384, 393, 396, 399, 400, 401,
              408, 410, 417, 419, 430, 448, 449, 482, 494, 498, 499, 536, 539,
              540, 544, 566, 574, 585, 592, 593, 595, 596, 597, 598, 601, 606,
              615, 616, 624, 631, 632, 633, 634, 635, 637, 639, 646, 655, 656,
              672, 677, 681, 686, 701, 704, 705, 711, 712, 714, 717, 719, 726,
              729, 743, 750, 752, 757, 762, 769, 776, 779, 792, 800, 807, 832,
              834, 841, 845, 846, 849, 850, 851, 852, 853, 854, 855, 859, 861,
              876, 881, 884, 885, 890, 893, 894, 897, 902, 904, 906, 908, 909,
              924, 925, 926, 927, 932, 944, 946, 953, 955, 961, 965, 969, 973,
              974, 975, 977, 983, 985, 988, 996, 1004, 1007, 1010, 1012, 1020,
              1022, 1023, 1024, 1025, 1027, 1029, 1039, 1041, 1043, 1048,
              1051, 1053, 1065, 1066, 1071, 1073, 1074, 1076, 1077, 1079,
              1080, 1084, 1088, 1089, 1091, 1092, 1097, 1100, 1101, 1106,
              1108, 1110, 1113, 1114, 1117, 1119, 1120, 1121, 1122, 1123,
              1124, 1125, 1127, 1130, 1134, 1140, 1142, 1151, 1152, 1153,
              1154, 1162, 1172, 1174, 1180, 1182, 1193, 1194, 1196, 1203,
              1208, 1209, 1215, 1220, 1222, 1223, 1228, 1236, 1238, 1239,
              1243, 1244, 1245, 1251, 1263, 1266, 1268, 1270, 1276, 1279,
              1280, 1281, 1282, 1287, 1292, 1293, 1297, 1298, 1303, 1305,
              1306, 1309, 1311, 1316, 1324, 1328, 1331, 1335, 1340, 1342,
              1348, 1350, 1351, 1352, 1353, 1355, 1356, 1357, 1358, 1359,
              1360, 1361, 1362, 1364, 1365, 1366, 1367, 1370, 1371, 1373,
              1374, 1377, 1379, 1380, 1386, 1389, 1390, 1392, 1393, 1397,
              1401, 1403, 1407, 1410, 1412, 1413, 1417, 1419, 1421, 1422,
              1423, 1425, 1430, 1432, 1437, 1442, 1443, 1444, 1445, 1450,
              1453, 1454, 1455, 1457, 1458, 1468, 1469, 1470, 1471, 1472,
              1480, 1481, 1482, 1483, 1485, 1488, 1489, 1495, 1499, 1500,
              1507, 1508, 1517, 1520, 1527, 1528, 1532, 1536, 1537, 1547,
              1554, 1555, 1556, 1564, 1566, 1567, 1569, 1570, 1574, 1576,
              1578, 1581, 1583, 1584, 1591, 1592, 1593, 1595, 1596, 1597,
              1598, 1599, 1600, 1601, 1605, 1606, 1607, 1608, 1610, 1612,
              1614, 1616, 1619, 1620, 1621, 1622, 1623, 1629, 1630, 1633,
              1635, 1639, 1640, 1643, 1644, 1646, 1647, 1648, 1649, 1652,
              1655, 1658, 1662, 1664, 1666, 1670, 1671, 1677, 1680, 1683,
              1688, 1689, 1691, 1693, 1703, 1704, 1705, 1706, 1709, 1710,
              1711, 1712, 1718, 1719, 1720, 1722, 1723, 1725, 1730, 1731,
              1733, 1735, 1736, 1737, 1741, 1742, 1743, 1746, 1749, 1756,
              1757, 1758, 1759, 1762, 1765, 1766, 1768, 1770, 1778, 1781,
              1784, 1789, 1796, 1797, 1798, 1801, 1802, 1804, 1811, 1818,
              1821, 1826, 1837, 1841, 1842, 1843, 1844, 1845, 1846, 1849,
              1850, 1851, 1852, 1853, 1858, 1859, 1862, 1864, 1865, 1867,
              1868, 1871, 1872, 1873, 1876, 1884, 1888, 1894, 1895, 1898,
              1904, 1908, 1910, 1911, 1915, 1916, 1917, 1919, 1928, 1929,
              1930, 1933, 1935, 1938, 1939, 1940, 1941, 1951, 1952, 1962,
              1963, 1970, 1974, 1977, 1987, 1989, 1996, 1997, 1999, 2004,
              2005, 2006, 2008, 2010, 2013, 2014, 2015, 2016, 2017, 2018,
              2021, 2022, 2023, 2024, 2025, 2029, 2031, 2032, 2034, 2036,
              2044, 2049, 2052, 2053, 2055, 2058, 2060, 2062, 2066, 2074,
              2077, 2078, 2080, 2081, 2082, 2086, 2089, 2090, 2092, 2093,
              2098, 2100, 2101, 2108, 2109, 2113, 2114, 2115, 2116, 2123,
              2124, 2125, 2126, 2127, 2129, 2131, 2135, 2136, 2137, 2138,
              2140, 2143, 2144, 2147, 2148, 2149, 2150, 2151, 2152, 2153,
              2154, 2160, 2161, 2163, 2164, 2165, 2167, 2168, 2169, 2171,
              2173, 2174, 2175, 2177, 2179, 2180, 2181, 2182, 2183, 2185,
              2188, 2190, 2195, 2196, 2200, 2202, 2204, 2208, 2210, 2213,
              2214, 2215, 2218, 2222, 2223, 2224, 2227, 2229, 2233, 2235,
              2236, 2238, 2240, 2247, 2248, 2253, 2257, 2258, 2260, 2261,
              2262, 2263, 2265, 2266, 2268, 2272, 2273, 2277, 2282, 2284,
              2285, 2286, 2287, 2288, 2290, 2291, 2292, 2293, 2294, 2299,
              2300, 2303, 2305, 2306, 2307, 2308, 2309, 2311, 2316, 2318,
              2319, 2324, 2328, 2332, 2333, 2338, 2339, 2344, 2345, 2348,
              2353, 2359, 2361, 2363, 2364, 2365, 2367, 2368, 2373, 2376,
              2378, 2383, 2384, 2385, 2390, 2391, 2392, 2401, 2403, 2404,
              2405, 2408, 2409, 2411, 2413, 2418, 2419, 2420, 2421, 2423,
              2426, 2430, 2435, 2436, 2437, 2438, 2439, 2441, 2442, 2445,
              2447, 2448, 2449, 2452, 2453, 2454, 2455, 2456, 2457, 2458,
              2459, 2465, 2466, 2467, 2468, 2469, 2470, 2471, 2472, 2473,
              2479, 2480, 2486, 2488, 2490, 2491, 2492, 2497, 2502, 2503,
              2504, 2506, 2507, 2509, 2511, 2512, 2523, 2525, 2526, 2529,
              2530, 2533, 2543, 2545, 2547, 2550, 2559, 2563, 2568, 2569,
              2572, 2573, 2575, 2577, 2579, 2581, 2582, 2583, 2584, 2585,
              2586, 2587, 2588, 2589, 2593, 2596, 2597, 2598, 2599, 2600,
              2601, 2602, 2606, 2607, 2611, 2612, 2613, 2618, 2624, 2625,
              2626, 2628, 2629, 2630, 2631, 2632, 2634, 2636, 2639, 2640,
              2641, 2642, 2647, 2648, 2649, 2651, 2652, 2654, 2657, 2661,
              2662, 2666, 2667, 2671, 2672, 2674, 2675, 2676, 2677, 2679,
              2680, 2683, 2687, 2689, 2690, 2692, 2696, 2698, 2699, 2700,
              2703, 2706, 2707, 2709, 2712, 2716, 2717, 2718, 2721, 2725,
              2726, 2728, 2729, 2730, 2731, 2732, 2733, 2734, 2735, 2737,
              2738, 2740, 2741, 2742, 2743, 2744, 2747, 2750, 2751, 2753,
              2754, 2756, 2757, 2758, 2759, 2760, 2762, 2763, 2764, 2765,
              2766, 2767, 2769, 2774, 2776, 2777, 2780, 2783, 2785, 2787,
              2788, 2790, 2792, 2793, 2794, 2796, 2797, 2799, 2800, 2802,
              2803, 2807, 2810, 2817, 2819, 2823, 2825, 2826, 2827, 2828,
              2832, 2834, 2836, 2844, 2847, 2849, 2850, 2851, 2853, 2854,
              2856, 2859, 2863, 2866, 2870, 2873, 2876, 2886, 2898, 2899,
              2900, 2901, 2902, 2903, 2905, 2907, 2908, 2911, 2912, 2913,
              2917, 2918, 2920, 2921, 2923, 2925, 2926, 2927, 2932, 2933,
              2934, 2935, 2936, 2937, 2938, 2941, 2943, 2947, 2949, 2951,
              2952, 2955, 2962, 2964, 2965, 2967, 2969, 2970, 2971, 2976,
              2979, 2981, 2982, 2984, 2985, 2987, 2988, 2993, 2996, 2997,
              2999
            ],
            "peaks": [
              {
                "center": 0,
                "spread": 75,
                "sites": 966,
                "log_adj_pvalue": -1027.36
              }
            ]
          }, {
            "db": 0,
            "id": "TTTCGGTAAATTTTCC",
            "alt": "MEME-4",
            "consensus": "TTTCGGTAAATTTTCC",
            "len": 16,
            "motif_evalue": "3.1e-1299",
            "motif_nsites": 1004,
            "n_tested": 142,
            "score_threshold": 5,
            "pwm": [
              [0.00102359, 2.21094e-05, 0.00400571, 0.994949], 
              [0.00600309, 0.00699342, 0.00201391, 0.98499], 
              [0.0129744, 0.00400571, 0.00300981, 0.98001], 
              [0.016958, 0.783809, 0.00500161, 0.194231], 
              [0.286852, 2.21094e-05, 0.695172, 0.0179539], 
              [0.0398647, 2.21094e-05, 0.960085, 2.76865e-05], 
              [0.00301539, 0.00500161, 0.00500161, 0.986981], 
              [0.950132, 0.00201391, 0.0368714, 0.0109826], 
              [0.846557, 0.00599751, 0.110569, 0.036877], 
              [0.920255, 2.21094e-05, 0.00400571, 0.0757171], 
              [0.265937, 0.10061, 0.00500161, 0.628451], 
              [0.00201949, 0.0119729, 2.21094e-05, 0.985985], 
              [0.00301539, 0.127499, 2.21094e-05, 0.869463], 
              [0.00500719, 0.00599751, 0.00101801, 0.987977], 
              [2.76865e-05, 0.805719, 2.21094e-05, 0.194231], 
              [0.00500719, 0.860494, 2.21094e-05, 0.134476]
            ],
            "total_sites": 1189,
            "sites": [
              0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0,
              0, 0, 0, 0, 0, 0, 0, 0.5, 1, 0, 0.5, 1, 0, 0, 0, 0, 0, 1, 0, 0,
              2, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 2, 0, 0, 2, 2, 1,
              2, 1, 1, 1, 0, 1, 1, 3, 1, 1, 4, 2, 4, 0, 4, 2, 2, 2, 0, 1, 0,
              1, 1, 1, 2, 0, 3, 2, 0, 4, 0, 2, 1, 3, 1.5, 1, 2, 1, 4, 5.5, 4,
              2, 2, 7, 5, 4, 3.5, 8.5, 7, 8, 12, 15, 11, 18, 7, 15, 13, 15,
              28.5, 21, 28, 30, 38, 35, 31, 22, 23, 18, 14.5, 4, 5, 7, 13, 7,
              5, 7, 4, 4, 5, 1, 6, 6, 7.5, 5, 5, 6, 7, 6, 6, 6, 8, 4, 6, 12,
              14, 17, 19, 16, 21, 32, 32, 31, 32, 30, 14, 20, 16, 17, 16, 16,
              16, 9, 6, 5, 8, 0, 6, 6, 3, 2, 3, 2, 2, 0, 1, 2, 2.5, 3, 2, 2,
              3, 0, 1, 2, 1, 2, 2, 0, 2, 0, 2, 1, 1, 1, 0, 1, 2, 4, 0, 2, 0,
              2, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 2, 2, 0, 1, 0, 1, 0, 0, 1, 2,
              0, 0, 0, 0, 0, 0, 2, 2, 1, 1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 1, 0,
              0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 2, 0, 3, 2, 2, 1, 0,
              0, 1, 0, 1, 0, 2, 1, 1, 1
            ],
            "seqs": [
              64, 65, 82, 98, 124, 127, 133, 140, 146, 163, 177, 179, 186,
              200, 203, 216, 225, 230, 233, 242, 246, 278, 289, 295, 300, 308,
              315, 318, 322, 330, 331, 336, 341, 345, 347, 352, 353, 357, 371,
              374, 375, 383, 384, 389, 393, 396, 399, 400, 401, 408, 410, 417,
              419, 430, 444, 448, 449, 462, 482, 494, 499, 536, 539, 540, 544,
              562, 566, 574, 585, 592, 593, 596, 597, 598, 601, 604, 606, 615,
              616, 624, 631, 632, 633, 634, 635, 639, 646, 654, 656, 668, 672,
              681, 686, 687, 696, 701, 703, 704, 705, 706, 711, 712, 714, 717,
              719, 726, 729, 743, 748, 750, 752, 757, 762, 769, 771, 776, 779,
              782, 788, 792, 800, 801, 806, 807, 832, 834, 841, 845, 846, 849,
              850, 851, 852, 853, 854, 855, 859, 861, 876, 881, 884, 885, 890,
              893, 894, 897, 904, 908, 909, 925, 926, 927, 932, 933, 942, 944,
              946, 952, 953, 955, 961, 965, 968, 969, 971, 973, 974, 975, 977,
              983, 985, 988, 989, 990, 996, 997, 1004, 1007, 1010, 1012, 1020,
              1022, 1023, 1024, 1025, 1027, 1029, 1032, 1039, 1041, 1048,
              1051, 1053, 1065, 1066, 1071, 1073, 1076, 1077, 1079, 1080,
              1084, 1088, 1089, 1091, 1092, 1094, 1099, 1101, 1106, 1108,
              1110, 1113, 1114, 1115, 1116, 1117, 1119, 1120, 1121, 1123,
              1124, 1125, 1127, 1130, 1131, 1133, 1140, 1142, 1152, 1153,
              1154, 1162, 1171, 1172, 1174, 1180, 1189, 1193, 1194, 1196,
              1203, 1208, 1209, 1215, 1222, 1223, 1228, 1237, 1238, 1239,
              1240, 1243, 1244, 1245, 1263, 1266, 1268, 1270, 1276, 1279,
              1280, 1281, 1282, 1287, 1292, 1293, 1297, 1298, 1303, 1305,
              1306, 1309, 1311, 1316, 1320, 1324, 1328, 1329, 1335, 1340,
              1342, 1348, 1350, 1351, 1353, 1354, 1355, 1356, 1357, 1358,
              1359, 1360, 1361, 1362, 1364, 1365, 1366, 1367, 1370, 1371,
              1373, 1374, 1377, 1378, 1380, 1386, 1389, 1390, 1392, 1393,
              1397, 1401, 1402, 1403, 1407, 1410, 1412, 1413, 1417, 1419,
              1420, 1421, 1422, 1423, 1425, 1430, 1432, 1437, 1442, 1443,
              1444, 1445, 1449, 1450, 1453, 1454, 1455, 1457, 1458, 1468,
              1469, 1470, 1471, 1472, 1473, 1479, 1480, 1481, 1482, 1483,
              1485, 1488, 1489, 1495, 1499, 1500, 1501, 1507, 1508, 1517,
              1520, 1527, 1528, 1532, 1536, 1537, 1547, 1554, 1555, 1556,
              1558, 1559, 1564, 1566, 1567, 1569, 1570, 1574, 1576, 1578,
              1581, 1584, 1591, 1592, 1593, 1594, 1595, 1596, 1597, 1598,
              1599, 1600, 1601, 1605, 1607, 1608, 1609, 1610, 1612, 1614,
              1616, 1619, 1620, 1622, 1623, 1629, 1630, 1633, 1635, 1639,
              1640, 1646, 1647, 1648, 1649, 1652, 1658, 1662, 1664, 1666,
              1670, 1671, 1677, 1682, 1683, 1688, 1691, 1693, 1703, 1704,
              1705, 1709, 1710, 1712, 1718, 1719, 1722, 1725, 1729, 1730,
              1731, 1733, 1735, 1736, 1737, 1740, 1741, 1742, 1743, 1746,
              1749, 1756, 1757, 1758, 1762, 1765, 1766, 1768, 1778, 1784,
              1789, 1796, 1797, 1798, 1801, 1802, 1804, 1811, 1812, 1818,
              1821, 1826, 1837, 1841, 1842, 1843, 1844, 1845, 1846, 1849,
              1850, 1852, 1858, 1859, 1861, 1862, 1864, 1865, 1867, 1868,
              1869, 1870, 1871, 1872, 1873, 1874, 1876, 1884, 1886, 1888,
              1889, 1894, 1895, 1898, 1910, 1911, 1915, 1916, 1917, 1919,
              1929, 1930, 1933, 1938, 1939, 1940, 1948, 1952, 1956, 1959,
              1962, 1963, 1970, 1974, 1987, 1988, 1989, 1996, 1997, 2000,
              2003, 2004, 2005, 2006, 2010, 2013, 2014, 2015, 2016, 2018,
              2019, 2021, 2022, 2023, 2024, 2029, 2031, 2032, 2033, 2034,
              2036, 2049, 2052, 2053, 2054, 2055, 2058, 2060, 2062, 2066,
              2074, 2077, 2078, 2080, 2081, 2082, 2086, 2089, 2090, 2091,
              2093, 2098, 2100, 2101, 2108, 2109, 2110, 2113, 2114, 2115,
              2116, 2121, 2124, 2125, 2131, 2133, 2135, 2136, 2138, 2140,
              2144, 2146, 2147, 2148, 2149, 2150, 2152, 2154, 2155, 2159,
              2160, 2161, 2162, 2163, 2164, 2165, 2167, 2168, 2169, 2171,
              2173, 2174, 2175, 2177, 2179, 2181, 2182, 2183, 2185, 2187,
              2188, 2190, 2195, 2196, 2200, 2202, 2204, 2210, 2212, 2213,
              2214, 2215, 2218, 2221, 2222, 2223, 2224, 2227, 2229, 2233,
              2235, 2236, 2238, 2240, 2247, 2257, 2258, 2260, 2261, 2265,
              2266, 2268, 2272, 2273, 2277, 2282, 2284, 2285, 2287, 2288,
              2290, 2292, 2293, 2294, 2300, 2301, 2302, 2303, 2304, 2305,
              2306, 2307, 2308, 2309, 2310, 2314, 2316, 2318, 2319, 2324,
              2328, 2332, 2333, 2337, 2338, 2339, 2344, 2345, 2348, 2352,
              2359, 2361, 2363, 2364, 2365, 2367, 2368, 2373, 2376, 2378,
              2381, 2383, 2384, 2387, 2389, 2390, 2391, 2392, 2401, 2402,
              2403, 2404, 2405, 2408, 2409, 2411, 2413, 2418, 2419, 2421,
              2423, 2426, 2435, 2436, 2437, 2438, 2439, 2440, 2441, 2442,
              2445, 2447, 2449, 2452, 2453, 2454, 2456, 2457, 2459, 2466,
              2467, 2468, 2469, 2470, 2471, 2473, 2480, 2485, 2486, 2487,
              2490, 2491, 2493, 2497, 2502, 2503, 2504, 2506, 2507, 2510,
              2511, 2512, 2523, 2525, 2526, 2527, 2529, 2530, 2533, 2543,
              2545, 2547, 2550, 2559, 2563, 2568, 2572, 2573, 2577, 2579,
              2581, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 2593, 2596,
              2597, 2599, 2606, 2607, 2609, 2612, 2613, 2614, 2618, 2622,
              2624, 2625, 2626, 2629, 2630, 2631, 2632, 2633, 2636, 2639,
              2641, 2647, 2648, 2649, 2654, 2655, 2657, 2661, 2662, 2667,
              2671, 2672, 2675, 2676, 2677, 2679, 2680, 2683, 2687, 2689,
              2690, 2692, 2696, 2699, 2700, 2703, 2706, 2707, 2709, 2711,
              2712, 2716, 2717, 2718, 2725, 2726, 2728, 2729, 2730, 2731,
              2735, 2737, 2738, 2739, 2740, 2742, 2743, 2747, 2750, 2751,
              2754, 2757, 2758, 2760, 2762, 2763, 2764, 2765, 2766, 2769,
              2774, 2777, 2778, 2779, 2780, 2786, 2787, 2790, 2792, 2793,
              2794, 2796, 2799, 2800, 2803, 2809, 2810, 2812, 2817, 2819,
              2823, 2825, 2826, 2827, 2832, 2833, 2834, 2836, 2842, 2844,
              2847, 2849, 2850, 2851, 2853, 2854, 2859, 2863, 2866, 2872,
              2873, 2886, 2889, 2898, 2899, 2900, 2901, 2902, 2903, 2905,
              2907, 2911, 2913, 2917, 2920, 2921, 2923, 2924, 2925, 2927,
              2933, 2934, 2935, 2937, 2938, 2941, 2943, 2946, 2947, 2949,
              2951, 2953, 2955, 2957, 2960, 2962, 2964, 2965, 2969, 2970,
              2975, 2976, 2979, 2981, 2982, 2983, 2985, 2987, 2988, 2993,
              2996, 2997, 2999
            ],
            "peaks": [
              {
                "center": 0,
                "spread": 69,
                "sites": 961.5,
                "log_adj_pvalue": -844.915
              }
            ]
          }, {
            "db": 0,
            "id": "TYGGCATAACCTCCCT",
            "alt": "MEME-5",
            "consensus": "TYGGCATAACCTCCCT",
            "len": 16,
            "motif_evalue": "5.3e-863",
            "motif_nsites": 689,
            "n_tested": 142,
            "score_threshold": 5,
            "pwm": [
              [4.03425e-05, 3.22159e-05, 3.22159e-05, 0.999895], 
              [0.00439371, 0.56889, 3.22159e-05, 0.426683], 
              [0.209009, 3.22159e-05, 0.772054, 0.0189056], 
              [0.294628, 3.22159e-05, 0.703849, 0.00149113], 
              [0.00439371, 0.7053, 0.18288, 0.107427], 
              [0.966518, 0.0203483, 0.00873895, 0.00439371], 
              [0.271409, 0.00148301, 0.00148301, 0.725624], 
              [0.988286, 0.00438558, 0.00728816, 4.03425e-05], 
              [0.996993, 0.00148301, 3.22159e-05, 0.00149113], 
              [0.0058455, 0.68063, 3.22159e-05, 0.313493], 
              [0.00149113, 0.956352, 0.00148301, 0.0406734], 
              [4.03425e-05, 3.22159e-05, 3.22159e-05, 0.999895], 
              [0.0667937, 0.806882, 0.00293479, 0.123389], 
              [0.00439371, 0.907013, 0.00293479, 0.0856589], 
              [0.0131004, 0.895403, 3.22159e-05, 0.0914641], 
              [0.00149113, 0.036311, 0.00293479, 0.959262]
            ],
            "total_sites": 1094,
            "sites": [
              0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
              0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 2, 1,
              0, 3, 1, 1, 1, 0, 0, 0, 2, 2, 1, 3, 3, 3, 1, 1, 4, 2, 2, 2, 1,
              0, 1, 1, 0, 3, 0, 2, 3, 0, 1, 3, 1, 0, 3, 2, 2, 1, 1, 1, 6, 3,
              2, 2, 6, 3, 4, 2, 3, 4, 7, 9, 9, 12, 9, 12, 8, 12, 21, 15, 21,
              23, 27, 34, 40, 31, 30, 21, 16, 17, 12, 7, 3, 7, 14, 5, 4, 7, 3,
              5, 4, 1, 2, 3, 0, 3, 3, 2, 1, 1, 1, 1, 1, 1, 0, 1, 0, 3, 0, 1,
              0, 0, 0, 0, 1, 0, 2, 1, 0, 0, 2, 1, 1, 1, 1, 0, 1, 0, 1, 4, 5,
              5, 2, 5, 4, 4, 3, 11, 5, 5, 3, 13, 15, 10, 20, 16, 16, 34, 26,
              31, 32, 28, 20, 13, 15, 17, 15, 17, 13, 15, 3, 6, 5, 3, 1, 3, 3,
              2, 1, 2, 1, 2, 0, 1, 2, 2, 2, 0, 1, 3, 0, 1, 1, 1, 1, 0, 0, 1,
              0, 1, 1, 1, 1, 0, 2, 2, 2, 0, 3, 1, 2, 0, 1, 0, 1, 0, 1, 1, 1,
              0, 1, 2, 2, 0, 1, 1, 1, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 2, 1,
              0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
              1, 0
            ],
            "seqs": [
              65, 82, 98, 124, 127, 140, 146, 163, 179, 203, 216, 225, 230,
              233, 242, 246, 278, 284, 289, 295, 300, 318, 322, 330, 331, 336,
              341, 345, 347, 352, 353, 357, 371, 374, 375, 383, 384, 393, 396,
              400, 401, 408, 410, 417, 419, 430, 448, 449, 482, 494, 499, 536,
              539, 540, 544, 562, 566, 574, 585, 592, 593, 595, 596, 597, 598,
              601, 604, 615, 616, 624, 631, 632, 633, 634, 635, 639, 646, 655,
              656, 668, 672, 677, 681, 686, 696, 701, 703, 704, 705, 706, 711,
              712, 717, 719, 726, 729, 737, 743, 748, 750, 752, 757, 762, 769,
              771, 776, 779, 782, 788, 792, 800, 801, 807, 832, 834, 837, 845,
              846, 849, 850, 851, 852, 853, 854, 855, 859, 861, 876, 881, 884,
              885, 890, 893, 894, 897, 902, 904, 908, 909, 925, 926, 927, 932,
              933, 942, 944, 946, 953, 955, 961, 965, 968, 969, 971, 973, 974,
              975, 977, 983, 985, 988, 996, 997, 1004, 1007, 1010, 1012, 1020,
              1022, 1023, 1024, 1025, 1027, 1039, 1041, 1048, 1051, 1053,
              1065, 1066, 1071, 1073, 1076, 1077, 1079, 1080, 1084, 1088,
              1089, 1091, 1092, 1094, 1101, 1106, 1108, 1110, 1113, 1114,
              1115, 1117, 1119, 1120, 1121, 1123, 1124, 1125, 1127, 1130,
              1133, 1140, 1142, 1152, 1153, 1154, 1162, 1172, 1174, 1180,
              1182, 1189, 1193, 1194, 1196, 1203, 1208, 1209, 1215, 1222,
              1223, 1228, 1237, 1238, 1239, 1240, 1243, 1244, 1263, 1266,
              1268, 1270, 1276, 1279, 1280, 1281, 1282, 1287, 1292, 1293,
              1297, 1298, 1303, 1305, 1306, 1309, 1311, 1316, 1320, 1324,
              1328, 1335, 1340, 1342, 1348, 1350, 1351, 1353, 1354, 1355,
              1356, 1358, 1359, 1360, 1362, 1364, 1365, 1366, 1367, 1370,
              1371, 1373, 1374, 1377, 1378, 1380, 1386, 1389, 1390, 1392,
              1393, 1397, 1401, 1402, 1403, 1407, 1410, 1412, 1413, 1417,
              1419, 1420, 1421, 1422, 1423, 1425, 1430, 1432, 1437, 1442,
              1443, 1444, 1445, 1449, 1450, 1453, 1454, 1455, 1457, 1458,
              1468, 1469, 1470, 1471, 1472, 1473, 1479, 1480, 1481, 1482,
              1483, 1485, 1488, 1489, 1495, 1499, 1500, 1501, 1507, 1508,
              1517, 1520, 1527, 1528, 1532, 1536, 1537, 1547, 1554, 1555,
              1556, 1558, 1559, 1564, 1566, 1567, 1569, 1570, 1574, 1576,
              1578, 1581, 1584, 1591, 1592, 1593, 1594, 1595, 1596, 1597,
              1598, 1599, 1600, 1601, 1605, 1607, 1609, 1610, 1612, 1614,
              1616, 1619, 1620, 1622, 1623, 1629, 1630, 1633, 1635, 1639,
              1640, 1643, 1644, 1646, 1647, 1648, 1649, 1652, 1655, 1658,
              1662, 1664, 1666, 1670, 1671, 1677, 1679, 1682, 1683, 1685,
              1688, 1691, 1693, 1703, 1704, 1705, 1709, 1710, 1712, 1718,
              1719, 1722, 1725, 1730, 1731, 1733, 1735, 1736, 1737, 1740,
              1741, 1742, 1743, 1746, 1749, 1756, 1757, 1758, 1762, 1765,
              1766, 1768, 1778, 1784, 1789, 1796, 1797, 1798, 1801, 1802,
              1804, 1811, 1812, 1818, 1821, 1826, 1837, 1841, 1842, 1843,
              1844, 1846, 1849, 1850, 1852, 1858, 1859, 1862, 1864, 1865,
              1867, 1868, 1869, 1870, 1871, 1872, 1874, 1876, 1884, 1888,
              1889, 1894, 1895, 1898, 1910, 1915, 1916, 1917, 1919, 1928,
              1929, 1930, 1933, 1935, 1938, 1939, 1940, 1948, 1952, 1956,
              1959, 1962, 1963, 1970, 1974, 1987, 1988, 1989, 1996, 1997,
              2000, 2003, 2004, 2005, 2006, 2010, 2013, 2014, 2015, 2016,
              2018, 2019, 2021, 2022, 2023, 2024, 2029, 2031, 2032, 2034,
              2036, 2049, 2052, 2053, 2055, 2058, 2060, 2062, 2066, 2074,
              2077, 2078, 2081, 2082, 2086, 2089, 2090, 2091, 2093, 2098,
              2100, 2101, 2108, 2109, 2113, 2114, 2115, 2116, 2121, 2125,
              2131, 2135, 2136, 2138, 2140, 2144, 2146, 2147, 2148, 2149,
              2150, 2152, 2154, 2155, 2159, 2160, 2161, 2162, 2163, 2164,
              2165, 2167, 2168, 2169, 2171, 2173, 2174, 2175, 2177, 2179,
              2181, 2182, 2183, 2185, 2187, 2188, 2190, 2195, 2196, 2200,
              2202, 2204, 2210, 2212, 2213, 2214, 2215, 2218, 2221, 2222,
              2223, 2224, 2227, 2229, 2233, 2235, 2236, 2238, 2240, 2247,
              2257, 2258, 2260, 2261, 2265, 2266, 2268, 2272, 2273, 2277,
              2282, 2284, 2285, 2287, 2288, 2290, 2292, 2293, 2294, 2300,
              2301, 2302, 2303, 2304, 2305, 2306, 2307, 2308, 2309, 2314,
              2316, 2318, 2319, 2324, 2328, 2332, 2333, 2337, 2338, 2339,
              2344, 2345, 2348, 2352, 2359, 2361, 2363, 2364, 2365, 2368,
              2373, 2376, 2378, 2381, 2383, 2384, 2389, 2390, 2391, 2392,
              2401, 2402, 2403, 2404, 2405, 2408, 2409, 2411, 2413, 2418,
              2419, 2421, 2423, 2435, 2436, 2437, 2438, 2439, 2440, 2441,
              2442, 2445, 2447, 2448, 2449, 2451, 2452, 2453, 2454, 2456,
              2457, 2459, 2460, 2466, 2467, 2468, 2469, 2470, 2471, 2473,
              2480, 2485, 2486, 2487, 2490, 2491, 2497, 2502, 2503, 2504,
              2506, 2507, 2510, 2511, 2512, 2523, 2525, 2526, 2529, 2530,
              2533, 2542, 2543, 2545, 2547, 2550, 2559, 2563, 2568, 2572,
              2573, 2577, 2579, 2581, 2583, 2584, 2585, 2586, 2587, 2588,
              2589, 2593, 2596, 2597, 2599, 2606, 2607, 2609, 2611, 2614,
              2622, 2624, 2625, 2626, 2629, 2630, 2631, 2632, 2633, 2636,
              2639, 2647, 2648, 2649, 2654, 2655, 2657, 2661, 2662, 2667,
              2671, 2672, 2675, 2676, 2677, 2679, 2680, 2683, 2687, 2689,
              2690, 2692, 2696, 2699, 2700, 2703, 2706, 2707, 2709, 2711,
              2712, 2716, 2717, 2718, 2725, 2726, 2728, 2729, 2730, 2731,
              2735, 2737, 2738, 2739, 2740, 2747, 2750, 2751, 2754, 2757,
              2758, 2760, 2762, 2763, 2764, 2765, 2766, 2769, 2774, 2777,
              2778, 2779, 2780, 2786, 2787, 2792, 2793, 2794, 2796, 2799,
              2800, 2803, 2809, 2810, 2812, 2817, 2819, 2823, 2825, 2826,
              2827, 2828, 2832, 2833, 2834, 2836, 2842, 2844, 2847, 2849,
              2850, 2851, 2853, 2854, 2859, 2863, 2866, 2873, 2886, 2889,
              2898, 2899, 2900, 2901, 2902, 2903, 2905, 2907, 2911, 2913,
              2917, 2920, 2921, 2923, 2924, 2925, 2927, 2933, 2934, 2935,
              2937, 2938, 2941, 2943, 2946, 2947, 2949, 2951, 2953, 2955,
              2962, 2964, 2965, 2969, 2970, 2975, 2976, 2979, 2981, 2982,
              2983, 2985, 2987, 2988, 2993, 2996, 2999
            ],
            "peaks": [
              {
                "center": 0,
                "spread": 105,
                "sites": 925,
                "log_adj_pvalue": -528.774
              }
            ]
          }, {
            "db": 1,
            "id": "GGGHCCM",
            "alt": "DREME-1",
            "consensus": "GGGHCCM",
            "len": 7,
            "motif_evalue": "3.8e-1059",
            "motif_nsites": 2949,
            "n_tested": 146,
            "score_threshold": 5,
            "pwm": [
              [9.4266e-06, 7.52772e-06, 0.999974, 9.4266e-06], 
              [9.4266e-06, 7.52772e-06, 0.999974, 9.4266e-06], 
              [9.4266e-06, 7.52772e-06, 0.999974, 9.4266e-06], 
              [0.387246, 0.362491, 7.52772e-06, 0.250255], 
              [9.4266e-06, 0.999974, 7.52772e-06, 9.4266e-06], 
              [9.4266e-06, 0.999974, 7.52772e-06, 9.4266e-06], 
              [0.560858, 0.439125, 7.52772e-06, 9.4266e-06]
            ],
            "total_sites": 2910,
            "sites": [
              0, 0, 0, 0, 0, 0, 0.5, 0.5, 0, 0, 0, 1, 0, 2, 1, 0, 0, 0, 2, 0,
              0, 0, 0, 0.5, 0, 1, 0.333333, 1.5, 0.5, 1, 0.25, 0.5, 0, 0.5,
              0.5, 0, 0, 1, 1.5, 0.5, 1.5, 1, 0, 1.25, 0.5, 0, 0, 0, 0, 0, 0,
              1, 1.5, 1, 1, 0, 0, 0.333333, 0.833333, 0, 0, 2.33333, 1.5,
              0.25, 0, 2, 0.5, 0, 0.5, 0, 1, 0.25, 1.5, 0, 0, 0, 1, 1, 1.5,
              1.5, 0.5, 0, 3, 2, 1.5, 5, 1.75, 1.25, 2, 0.916667, 0, 2, 3,
              1.5, 2.5, 4.25, 3, 4.33333, 0.333333, 2.5, 3, 5, 2, 2, 1.5,
              1.75, 6, 2.5, 0, 3, 2, 3, 5.5, 0, 5.33333, 1.5, 5, 1, 2, 4.5, 4,
              3, 1, 6.5, 7, 8.5, 4.83333, 5.83333, 10.3333, 14.0833, 18, 10.5,
              19.5, 15.5, 22.5, 33, 27, 37.8333, 42.25, 39, 39.3333, 75.5,
              63.5, 119, 116.5, 126.333, 162.5, 190.117, 227.667, 205.75,
              163.583, 145.333, 94, 107, 58.0833, 54.25, 43.5, 53.3333,
              49.5833, 25.8333, 24.5, 23.8333, 28.0833, 9, 14.5, 11.0333,
              5.03333, 11, 9, 10, 7, 6.66667, 6.75, 5.5, 10, 3.5, 3.5, 3.25,
              4.25, 2, 3.25, 4, 5.33333, 2.5, 2, 1.5, 3.5, 2.5, 3, 4.5, 2.5,
              3, 1, 2.33333, 2, 3.25, 3, 2, 1, 2.33333, 2, 1.5, 0.5, 2.5, 1,
              1, 1, 2.25, 1.25, 1.5, 1, 3.5, 0.5, 2, 0.5, 2, 0.5, 0, 1.5, 3.5,
              0.5, 0.333333, 1.33333, 3.5, 0.5, 0.5, 0, 3, 1.5, 0.5, 0.5, 0,
              0.333333, 0.5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0.5, 0, 0, 1, 0.25, 0,
              1, 0, 0.5, 0, 0.5, 0, 1.5, 0.333333, 0.5, 0, 0.5, 0, 1, 0.75,
              0.5, 0.5, 0, 1.83333, 0, 0, 0, 1.5, 0.25, 0, 1.83333, 0,
              1.53333, 0.2, 0.5, 0, 1, 0, 1.33333, 1.33333, 0.333333, 0, 0.5,
              1, 0, 0, 0, 0, 0, 0.666667, 0.333333
            ],
            "seqs": [
              0, 2, 4, 5, 6, 7, 8, 9, 11, 12, 14, 15, 16, 17, 18, 19, 20, 23,
              24, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
              41, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
              58, 59, 60, 61, 62, 63, 64, 66, 67, 69, 70, 71, 72, 73, 74, 75,
              76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 87, 88, 89, 90, 92, 93,
              94, 95, 96, 97, 99, 100, 101, 102, 104, 105, 106, 108, 109, 110,
              111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
              125, 126, 128, 129, 130, 132, 134, 135, 136, 137, 138, 139, 140,
              141, 142, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
              156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168,
              169, 170, 171, 172, 173, 174, 175, 176, 177, 179, 180, 181, 182,
              183, 184, 185, 186, 187, 188, 189, 191, 192, 193, 194, 195, 197,
              198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210,
              211, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224,
              225, 226, 228, 230, 231, 232, 233, 234, 235, 237, 238, 239, 240,
              241, 242, 244, 245, 246, 248, 249, 250, 251, 252, 253, 254, 255,
              256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 270, 271,
              273, 275, 276, 277, 278, 281, 282, 283, 285, 286, 287, 288, 289,
              290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302,
              303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 316,
              317, 318, 319, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330,
              332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
              345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 357, 358,
              359, 360, 361, 363, 364, 365, 366, 369, 370, 371, 372, 373, 374,
              375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387,
              388, 389, 390, 391, 393, 395, 396, 398, 401, 402, 403, 404, 405,
              406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 419,
              420, 421, 422, 423, 425, 426, 427, 428, 429, 430, 431, 432, 433,
              434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446,
              447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460,
              461, 462, 463, 464, 465, 467, 468, 470, 471, 472, 473, 475, 476,
              477, 478, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490,
              492, 493, 494, 495, 496, 499, 503, 504, 505, 506, 507, 509, 510,
              511, 513, 515, 516, 517, 518, 521, 522, 523, 524, 525, 527, 528,
              530, 531, 533, 534, 536, 537, 538, 539, 540, 541, 542, 543, 544,
              545, 546, 547, 548, 549, 550, 551, 552, 553, 555, 556, 557, 558,
              559, 560, 561, 562, 563, 564, 565, 567, 568, 569, 570, 572, 573,
              574, 575, 576, 577, 578, 579, 580, 582, 584, 585, 587, 588, 589,
              590, 591, 592, 593, 594, 595, 596, 598, 599, 600, 601, 602, 603,
              605, 606, 607, 608, 609, 610, 611, 612, 614, 615, 616, 617, 619,
              622, 624, 625, 626, 627, 628, 629, 630, 632, 633, 634, 635, 636,
              638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 649, 651, 652,
              653, 654, 655, 656, 658, 659, 660, 661, 662, 663, 664, 665, 666,
              667, 669, 671, 672, 673, 674, 675, 676, 677, 679, 680, 681, 683,
              684, 686, 687, 688, 689, 690, 692, 693, 694, 696, 697, 698, 699,
              700, 701, 703, 704, 705, 706, 708, 710, 711, 712, 713, 714, 715,
              716, 717, 718, 719, 720, 721, 722, 724, 725, 726, 727, 729, 730,
              731, 733, 734, 735, 736, 737, 738, 739, 740, 741, 743, 744, 745,
              746, 747, 748, 749, 750, 751, 752, 755, 756, 757, 759, 760, 761,
              762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 775, 776,
              777, 778, 779, 780, 781, 782, 783, 785, 786, 787, 788, 790, 792,
              793, 794, 796, 797, 799, 800, 802, 803, 804, 805, 806, 807, 809,
              810, 811, 812, 813, 815, 816, 817, 819, 821, 822, 823, 824, 826,
              827, 828, 829, 830, 831, 832, 833, 834, 836, 837, 838, 839, 840,
              841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853,
              854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 867, 868,
              869, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882,
              883, 885, 886, 888, 889, 890, 891, 892, 893, 894, 895, 896, 898,
              899, 900, 902, 903, 904, 905, 906, 907, 909, 910, 911, 912, 913,
              914, 915, 916, 917, 919, 920, 921, 925, 926, 927, 929, 930, 932,
              933, 935, 936, 937, 938, 940, 941, 942, 944, 945, 946, 947, 948,
              949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961,
              962, 964, 965, 966, 967, 968, 970, 971, 972, 973, 974, 975, 976,
              977, 978, 979, 980, 981, 983, 984, 985, 986, 987, 989, 990, 992,
              993, 994, 995, 996, 997, 998, 1000, 1001, 1003, 1004, 1005,
              1006, 1007, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017,
              1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1028,
              1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1040, 1041,
              1042, 1043, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052,
              1053, 1054, 1055, 1056, 1057, 1060, 1061, 1062, 1064, 1065,
              1066, 1067, 1068, 1070, 1071, 1073, 1075, 1077, 1078, 1079,
              1080, 1081, 1083, 1085, 1086, 1088, 1089, 1090, 1091, 1092,
              1093, 1094, 1095, 1099, 1102, 1103, 1105, 1107, 1108, 1109,
              1110, 1111, 1112, 1113, 1114, 1115, 1117, 1118, 1119, 1120,
              1121, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131,
              1132, 1133, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142,
              1144, 1145, 1146, 1147, 1148, 1149, 1150, 1152, 1153, 1154,
              1155, 1156, 1157, 1158, 1159, 1160, 1161, 1162, 1163, 1164,
              1165, 1166, 1167, 1169, 1170, 1172, 1173, 1174, 1175, 1176,
              1177, 1178, 1179, 1180, 1181, 1182, 1183, 1184, 1185, 1186,
              1187, 1188, 1189, 1191, 1192, 1193, 1194, 1196, 1198, 1200,
              1202, 1203, 1204, 1205, 1206, 1208, 1209, 1213, 1214, 1216,
              1217, 1218, 1219, 1221, 1222, 1223, 1224, 1225, 1227, 1228,
              1229, 1230, 1231, 1233, 1238, 1239, 1241, 1242, 1244, 1245,
              1246, 1247, 1250, 1252, 1254, 1255, 1259, 1260, 1261, 1262,
              1263, 1264, 1265, 1266, 1267, 1268, 1270, 1272, 1273, 1274,
              1275, 1276, 1278, 1279, 1280, 1281, 1282, 1283, 1284, 1285,
              1287, 1288, 1289, 1290, 1291, 1292, 1293, 1294, 1295, 1296,
              1297, 1298, 1299, 1300, 1301, 1302, 1304, 1305, 1306, 1307,
              1308, 1309, 1310, 1311, 1312, 1313, 1314, 1316, 1318, 1319,
              1320, 1324, 1325, 1326, 1327, 1328, 1329, 1330, 1333, 1334,
              1335, 1336, 1337, 1338, 1339, 1340, 1342, 1343, 1344, 1345,
              1346, 1348, 1349, 1350, 1351, 1353, 1354, 1355, 1356, 1358,
              1359, 1362, 1364, 1365, 1366, 1368, 1370, 1371, 1372, 1373,
              1374, 1375, 1376, 1377, 1379, 1380, 1381, 1382, 1383, 1384,
              1385, 1387, 1388, 1389, 1390, 1391, 1392, 1393, 1394, 1395,
              1396, 1397, 1398, 1399, 1401, 1403, 1404, 1405, 1406, 1407,
              1408, 1410, 1411, 1412, 1413, 1415, 1416, 1417, 1419, 1420,
              1421, 1422, 1423, 1425, 1426, 1428, 1429, 1430, 1431, 1432,
              1433, 1435, 1436, 1437, 1439, 1440, 1441, 1442, 1443, 1444,
              1445, 1446, 1447, 1448, 1449, 1450, 1451, 1452, 1453, 1454,
              1455, 1456, 1457, 1458, 1459, 1460, 1462, 1463, 1465, 1467,
              1468, 1469, 1470, 1471, 1475, 1478, 1480, 1481, 1482, 1483,
              1485, 1486, 1487, 1488, 1489, 1490, 1493, 1494, 1495, 1496,
              1497, 1498, 1499, 1500, 1501, 1502, 1503, 1504, 1505, 1506,
              1507, 1509, 1511, 1512, 1513, 1514, 1515, 1516, 1517, 1519,
              1521, 1522, 1523, 1524, 1525, 1526, 1527, 1528, 1529, 1530,
              1531, 1532, 1533, 1534, 1535, 1536, 1537, 1538, 1539, 1540,
              1542, 1543, 1545, 1546, 1547, 1548, 1549, 1550, 1551, 1552,
              1553, 1554, 1555, 1558, 1559, 1560, 1561, 1563, 1564, 1565,
              1566, 1567, 1568, 1569, 1570, 1571, 1572, 1573, 1574, 1576,
              1577, 1578, 1579, 1581, 1589, 1590, 1591, 1592, 1593, 1594,
              1595, 1596, 1597, 1598, 1599, 1600, 1601, 1602, 1603, 1604,
              1605, 1608, 1609, 1610, 1611, 1612, 1614, 1615, 1616, 1617,
              1618, 1619, 1620, 1622, 1624, 1625, 1626, 1627, 1628, 1629,
              1631, 1632, 1633, 1634, 1639, 1640, 1641, 1642, 1643, 1644,
              1645, 1646, 1648, 1649, 1650, 1652, 1654, 1656, 1657, 1658,
              1659, 1661, 1662, 1663, 1664, 1665, 1666, 1668, 1669, 1670,
              1671, 1674, 1675, 1676, 1677, 1678, 1681, 1683, 1685, 1686,
              1687, 1688, 1690, 1691, 1692, 1693, 1694, 1695, 1697, 1698,
              1699, 1700, 1702, 1703, 1705, 1707, 1708, 1709, 1710, 1712,
              1713, 1714, 1715, 1716, 1717, 1718, 1719, 1722, 1724, 1725,
              1727, 1730, 1731, 1732, 1733, 1735, 1736, 1737, 1738, 1740,
              1741, 1742, 1743, 1746, 1747, 1748, 1750, 1752, 1753, 1756,
              1757, 1758, 1761, 1762, 1763, 1764, 1765, 1766, 1768, 1770,
              1771, 1773, 1776, 1777, 1778, 1779, 1783, 1784, 1785, 1786,
              1788, 1789, 1790, 1791, 1792, 1793, 1796, 1797, 1798, 1799,
              1800, 1801, 1802, 1804, 1805, 1806, 1807, 1809, 1810, 1811,
              1812, 1813, 1814, 1815, 1817, 1818, 1820, 1821, 1822, 1823,
              1824, 1825, 1827, 1828, 1829, 1832, 1833, 1836, 1837, 1838,
              1840, 1841, 1842, 1843, 1844, 1845, 1846, 1848, 1849, 1850,
              1852, 1854, 1857, 1858, 1859, 1860, 1861, 1862, 1863, 1864,
              1867, 1868, 1870, 1871, 1872, 1874, 1875, 1876, 1877, 1878,
              1879, 1880, 1881, 1882, 1883, 1884, 1888, 1890, 1891, 1892,
              1894, 1895, 1896, 1897, 1898, 1899, 1900, 1901, 1902, 1903,
              1906, 1907, 1910, 1912, 1913, 1914, 1915, 1916, 1917, 1919,
              1920, 1922, 1923, 1924, 1925, 1926, 1927, 1929, 1930, 1931,
              1933, 1934, 1935, 1936, 1937, 1938, 1939, 1940, 1942, 1944,
              1947, 1948, 1949, 1950, 1952, 1953, 1954, 1957, 1958, 1960,
              1961, 1962, 1963, 1964, 1966, 1968, 1970, 1971, 1972, 1974,
              1975, 1976, 1979, 1980, 1981, 1985, 1987, 1988, 1989, 1991,
              1992, 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2004, 2006,
              2007, 2009, 2011, 2013, 2014, 2015, 2016, 2018, 2020, 2021,
              2022, 2023, 2024, 2026, 2027, 2028, 2029, 2030, 2031, 2032,
              2033, 2034, 2035, 2037, 2039, 2040, 2042, 2045, 2046, 2047,
              2048, 2049, 2050, 2052, 2053, 2054, 2055, 2056, 2058, 2059,
              2060, 2063, 2065, 2066, 2067, 2068, 2069, 2070, 2071, 2072,
              2073, 2074, 2075, 2077, 2078, 2080, 2081, 2082, 2084, 2085,
              2086, 2087, 2089, 2090, 2093, 2094, 2096, 2097, 2098, 2100,
              2101, 2102, 2104, 2105, 2106, 2108, 2109, 2110, 2112, 2113,
              2114, 2116, 2118, 2120, 2121, 2124, 2125, 2130, 2131, 2132,
              2133, 2134, 2135, 2136, 2138, 2140, 2141, 2142, 2143, 2147,
              2148, 2149, 2150, 2152, 2154, 2156, 2157, 2159, 2160, 2161,
              2162, 2163, 2164, 2165, 2166, 2167, 2168, 2169, 2173, 2174,
              2175, 2178, 2179, 2181, 2182, 2183, 2185, 2186, 2187, 2188,
              2189, 2190, 2191, 2192, 2193, 2194, 2195, 2196, 2197, 2200,
              2201, 2202, 2203, 2204, 2205, 2207, 2209, 2210, 2213, 2214,
              2215, 2218, 2219, 2221, 2222, 2223, 2224, 2225, 2227, 2228,
              2230, 2231, 2232, 2233, 2234, 2235, 2236, 2237, 2238, 2239,
              2241, 2243, 2245, 2246, 2247, 2249, 2252, 2254, 2255, 2257,
              2258, 2259, 2260, 2261, 2264, 2266, 2267, 2268, 2269, 2270,
              2271, 2272, 2273, 2275, 2276, 2277, 2279, 2280, 2281, 2282,
              2283, 2284, 2285, 2287, 2288, 2289, 2290, 2294, 2296, 2297,
              2298, 2300, 2303, 2305, 2306, 2307, 2308, 2309, 2313, 2314,
              2315, 2316, 2318, 2319, 2320, 2322, 2324, 2325, 2326, 2329,
              2330, 2331, 2332, 2333, 2336, 2338, 2339, 2340, 2341, 2342,
              2343, 2344, 2345, 2348, 2349, 2350, 2351, 2352, 2354, 2356,
              2357, 2358, 2359, 2360, 2362, 2363, 2364, 2365, 2366, 2367,
              2368, 2370, 2372, 2373, 2375, 2376, 2377, 2378, 2379, 2381,
              2382, 2383, 2384, 2386, 2387, 2388, 2389, 2390, 2391, 2392,
              2393, 2394, 2395, 2396, 2398, 2399, 2400, 2401, 2402, 2403,
              2404, 2405, 2406, 2407, 2408, 2411, 2412, 2413, 2414, 2415,
              2417, 2418, 2419, 2421, 2423, 2424, 2427, 2428, 2429, 2431,
              2432, 2433, 2436, 2437, 2438, 2439, 2441, 2442, 2443, 2445,
              2446, 2447, 2448, 2449, 2450, 2452, 2453, 2454, 2456, 2459,
              2461, 2463, 2464, 2466, 2467, 2468, 2469, 2470, 2471, 2473,
              2474, 2475, 2476, 2477, 2480, 2482, 2484, 2486, 2489, 2491,
              2494, 2495, 2496, 2497, 2498, 2499, 2500, 2502, 2503, 2504,
              2505, 2506, 2507, 2508, 2512, 2513, 2515, 2516, 2518, 2521,
              2522, 2523, 2524, 2525, 2527, 2528, 2529, 2530, 2532, 2533,
              2534, 2537, 2538, 2539, 2540, 2541, 2542, 2543, 2544, 2545,
              2546, 2547, 2548, 2550, 2551, 2552, 2553, 2554, 2555, 2556,
              2557, 2558, 2559, 2560, 2561, 2562, 2565, 2566, 2571, 2572,
              2573, 2577, 2578, 2579, 2581, 2583, 2584, 2585, 2586, 2587,
              2589, 2591, 2592, 2593, 2596, 2597, 2599, 2604, 2606, 2607,
              2608, 2609, 2611, 2616, 2618, 2619, 2620, 2621, 2622, 2624,
              2625, 2626, 2629, 2630, 2631, 2632, 2633, 2635, 2636, 2637,
              2638, 2639, 2641, 2643, 2644, 2647, 2648, 2649, 2650, 2653,
              2654, 2656, 2657, 2658, 2659, 2660, 2661, 2662, 2663, 2664,
              2667, 2669, 2670, 2671, 2672, 2675, 2676, 2679, 2680, 2681,
              2683, 2685, 2687, 2689, 2690, 2692, 2693, 2694, 2696, 2697,
              2699, 2700, 2701, 2702, 2703, 2704, 2705, 2706, 2707, 2708,
              2711, 2714, 2716, 2717, 2719, 2720, 2722, 2724, 2725, 2726,
              2728, 2729, 2730, 2731, 2735, 2736, 2738, 2742, 2743, 2746,
              2747, 2748, 2749, 2751, 2752, 2754, 2755, 2757, 2760, 2762,
              2763, 2764, 2765, 2766, 2769, 2770, 2772, 2773, 2774, 2777,
              2780, 2786, 2787, 2791, 2792, 2793, 2794, 2800, 2801, 2803,
              2804, 2805, 2811, 2814, 2816, 2817, 2818, 2819, 2820, 2821,
              2822, 2823, 2824, 2825, 2826, 2827, 2828, 2829, 2832, 2833,
              2834, 2835, 2836, 2837, 2838, 2839, 2840, 2841, 2842, 2843,
              2844, 2846, 2847, 2848, 2851, 2853, 2857, 2859, 2860, 2861,
              2862, 2864, 2865, 2869, 2871, 2872, 2873, 2874, 2875, 2879,
              2880, 2882, 2883, 2884, 2886, 2887, 2889, 2890, 2891, 2892,
              2893, 2894, 2897, 2898, 2899, 2900, 2901, 2902, 2903, 2905,
              2906, 2907, 2909, 2910, 2911, 2913, 2916, 2917, 2919, 2920,
              2921, 2922, 2923, 2924, 2925, 2929, 2930, 2933, 2934, 2935,
              2936, 2938, 2939, 2940, 2941, 2943, 2944, 2945, 2948, 2949,
              2950, 2951, 2954, 2955, 2959, 2960, 2962, 2964, 2965, 2969,
              2970, 2972, 2973, 2975, 2976, 2977, 2980, 2981, 2982, 2985,
              2986, 2987, 2990, 2991, 2993, 2994, 2996, 2997, 2998, 2999
            ],
            "peaks": [
              {
                "center": 0,
                "spread": 24,
                "sites": 2273.95,
                "log_adj_pvalue": -4222.59
              }
            ]
          }, {
            "db": 1,
            "id": "AAATYCGG",
            "alt": "DREME-2",
            "consensus": "AAATTCGG",
            "len": 8,
            "motif_evalue": "5.9e-258",
            "motif_nsites": 1125,
            "n_tested": 146,
            "score_threshold": 5,
            "pwm": [
              [0.999936, 1.97316e-05, 1.97316e-05, 2.47089e-05], 
              [0.999936, 1.97316e-05, 1.97316e-05, 2.47089e-05], 
              [0.999936, 1.97316e-05, 1.97316e-05, 2.47089e-05], 
              [2.47089e-05, 1.97316e-05, 1.97316e-05, 0.999936], 
              [2.47089e-05, 0.167116, 1.97316e-05, 0.83284], 
              [2.47089e-05, 0.999931, 1.97316e-05, 2.47089e-05], 
              [2.47089e-05, 1.97316e-05, 0.999931, 2.47089e-05], 
              [2.47089e-05, 1.97316e-05, 0.999931, 2.47089e-05]
            ],
            "total_sites": 959,
            "sites": [
              1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0.5, 0, 0,
              0.5, 0, 0.5, 1, 0, 0, 1, 0.5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
              0, 0, 0.5, 0, 0, 0, 0, 0, 1, 0.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
              0.333333, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1.33333, 0,
              0, 0, 0, 0.5, 0.5, 0, 0, 1, 0, 2.5, 0, 0.5, 0.5, 0.5, 0, 0, 1.5,
              2.5, 4.5, 3, 2.5, 2, 2, 3.5, 5, 3, 4, 3.5, 6.5, 10, 7.5, 14.5,
              14, 9.5, 10.5, 13, 19, 18, 23.5, 14.5, 13.8333, 21, 14.5, 17,
              21.5, 11, 21, 11, 9.5, 8.5, 9.5, 7, 10, 3, 6.5, 5, 4.5, 2.5, 6,
              2.5, 2.5, 5, 1, 3.5, 2, 3, 4, 0.5, 2.5, 1, 3, 5, 1.5, 2, 1.5, 2,
              1, 1.83333, 2.5, 1, 2, 5.5, 4, 7, 2, 8.5, 3, 8, 4.5, 7, 7, 7, 8,
              9.5, 13, 14, 14.5, 16.5, 12.5, 22.5, 17, 15.5, 21.5, 26.5,
              19.3333, 18.5, 25, 27, 26.5, 18.5, 17.5, 10, 11.5, 2.5, 2.5, 3,
              5, 3.5, 1, 1.5, 1.5, 2.5, 4, 0.5, 3, 0.5, 1.5, 0.5, 0.5, 1, 2,
              2, 1.5, 0, 0, 1, 1, 0, 0, 0, 0.5, 0.5, 2, 0, 0, 0, 0.5, 0, 1,
              1.5, 1, 0, 0.5, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
              0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
              0, 0, 0.5, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0.333333, 0, 0,
              0, 0, 0, 0, 1, 0, 0, 0.5, 0
            ],
            "seqs": [
              20, 22, 28, 39, 55, 66, 73, 82, 84, 90, 92, 97, 101, 103, 111,
              112, 117, 124, 127, 133, 140, 146, 156, 163, 179, 203, 216, 225,
              230, 233, 242, 246, 249, 252, 278, 289, 295, 301, 304, 305, 321,
              322, 330, 334, 336, 338, 341, 345, 352, 353, 357, 361, 364, 371,
              374, 375, 383, 384, 385, 393, 396, 399, 400, 401, 402, 408, 410,
              411, 416, 417, 419, 423, 424, 430, 439, 447, 448, 449, 468, 469,
              476, 482, 490, 494, 498, 499, 523, 536, 539, 540, 544, 558, 562,
              574, 576, 585, 592, 593, 595, 598, 601, 606, 615, 616, 624, 632,
              633, 634, 637, 639, 640, 655, 656, 659, 664, 668, 672, 677, 680,
              681, 683, 701, 703, 704, 711, 712, 714, 717, 719, 720, 724, 726,
              729, 734, 743, 747, 752, 757, 762, 771, 776, 779, 792, 797, 800,
              801, 807, 832, 834, 841, 842, 845, 846, 849, 850, 851, 852, 853,
              854, 855, 861, 881, 884, 885, 893, 897, 904, 909, 924, 925, 927,
              933, 942, 944, 946, 949, 953, 961, 965, 968, 973, 975, 977, 978,
              983, 985, 988, 990, 1004, 1007, 1010, 1012, 1017, 1020, 1022,
              1023, 1024, 1025, 1027, 1029, 1041, 1043, 1048, 1051, 1053,
              1063, 1066, 1067, 1071, 1073, 1074, 1089, 1097, 1100, 1101,
              1106, 1108, 1110, 1111, 1113, 1114, 1116, 1119, 1120, 1121,
              1122, 1123, 1125, 1127, 1130, 1134, 1140, 1142, 1151, 1152,
              1153, 1154, 1167, 1171, 1172, 1174, 1180, 1193, 1194, 1196,
              1203, 1208, 1209, 1215, 1220, 1222, 1228, 1236, 1238, 1239,
              1244, 1245, 1251, 1266, 1276, 1279, 1280, 1281, 1282, 1287,
              1293, 1297, 1298, 1302, 1303, 1305, 1306, 1309, 1311, 1316,
              1328, 1331, 1335, 1342, 1348, 1350, 1351, 1352, 1353, 1354,
              1355, 1356, 1357, 1358, 1359, 1360, 1361, 1362, 1363, 1364,
              1366, 1367, 1370, 1371, 1377, 1379, 1380, 1389, 1390, 1392,
              1393, 1397, 1401, 1402, 1403, 1406, 1407, 1410, 1412, 1413,
              1417, 1421, 1422, 1423, 1425, 1430, 1432, 1442, 1443, 1444,
              1445, 1449, 1450, 1458, 1468, 1469, 1470, 1471, 1472, 1479,
              1480, 1481, 1483, 1485, 1488, 1489, 1495, 1500, 1508, 1527,
              1528, 1532, 1536, 1537, 1547, 1554, 1555, 1556, 1564, 1566,
              1567, 1569, 1570, 1581, 1583, 1584, 1588, 1593, 1594, 1595,
              1596, 1597, 1598, 1599, 1600, 1606, 1608, 1610, 1612, 1614,
              1615, 1616, 1619, 1620, 1621, 1622, 1623, 1630, 1633, 1635,
              1639, 1640, 1642, 1643, 1644, 1646, 1649, 1652, 1655, 1658,
              1664, 1666, 1670, 1671, 1677, 1685, 1688, 1689, 1691, 1693,
              1704, 1705, 1706, 1709, 1710, 1711, 1712, 1718, 1720, 1721,
              1722, 1723, 1725, 1730, 1731, 1735, 1736, 1738, 1740, 1743,
              1746, 1749, 1755, 1757, 1758, 1759, 1765, 1766, 1770, 1778,
              1784, 1789, 1796, 1797, 1798, 1801, 1802, 1804, 1811, 1816,
              1821, 1826, 1830, 1837, 1839, 1841, 1842, 1843, 1846, 1849,
              1850, 1851, 1852, 1853, 1858, 1859, 1862, 1864, 1865, 1866,
              1867, 1871, 1873, 1876, 1884, 1886, 1888, 1889, 1894, 1895,
              1898, 1910, 1911, 1915, 1916, 1917, 1919, 1928, 1929, 1930,
              1933, 1935, 1938, 1939, 1940, 1951, 1963, 1970, 1977, 1986,
              1987, 1989, 1996, 1997, 1999, 2005, 2006, 2008, 2010, 2012,
              2013, 2014, 2015, 2016, 2018, 2019, 2021, 2022, 2024, 2025,
              2028, 2031, 2032, 2033, 2034, 2036, 2044, 2049, 2052, 2053,
              2055, 2058, 2060, 2062, 2074, 2077, 2078, 2080, 2086, 2089,
              2090, 2092, 2093, 2098, 2100, 2101, 2108, 2113, 2116, 2124,
              2125, 2126, 2127, 2129, 2135, 2136, 2138, 2139, 2140, 2143,
              2144, 2148, 2149, 2150, 2151, 2152, 2153, 2154, 2155, 2161,
              2162, 2163, 2165, 2167, 2168, 2169, 2172, 2173, 2174, 2175,
              2176, 2180, 2183, 2185, 2189, 2190, 2195, 2202, 2208, 2212,
              2213, 2215, 2218, 2221, 2223, 2224, 2227, 2229, 2233, 2235,
              2238, 2239, 2240, 2246, 2247, 2248, 2253, 2255, 2257, 2258,
              2260, 2261, 2262, 2263, 2268, 2270, 2273, 2277, 2282, 2283,
              2285, 2286, 2287, 2288, 2290, 2291, 2292, 2293, 2294, 2295,
              2303, 2305, 2306, 2307, 2308, 2309, 2311, 2313, 2314, 2316,
              2318, 2324, 2328, 2333, 2334, 2335, 2337, 2338, 2339, 2345,
              2348, 2353, 2359, 2364, 2365, 2367, 2368, 2378, 2384, 2385,
              2389, 2390, 2391, 2401, 2403, 2404, 2405, 2411, 2413, 2416,
              2418, 2420, 2421, 2423, 2425, 2426, 2430, 2436, 2437, 2439,
              2441, 2442, 2445, 2447, 2448, 2449, 2454, 2456, 2457, 2458,
              2459, 2465, 2466, 2467, 2468, 2469, 2471, 2472, 2473, 2479,
              2486, 2487, 2491, 2492, 2502, 2503, 2504, 2506, 2507, 2509,
              2512, 2515, 2523, 2526, 2530, 2533, 2543, 2545, 2547, 2559,
              2568, 2569, 2572, 2573, 2575, 2579, 2581, 2582, 2583, 2584,
              2585, 2586, 2587, 2589, 2594, 2595, 2597, 2598, 2599, 2600,
              2601, 2602, 2606, 2607, 2611, 2613, 2618, 2624, 2625, 2626,
              2627, 2628, 2629, 2630, 2631, 2632, 2634, 2636, 2639, 2641,
              2642, 2647, 2648, 2649, 2651, 2652, 2654, 2657, 2662, 2666,
              2671, 2675, 2676, 2677, 2680, 2683, 2690, 2696, 2699, 2700,
              2703, 2706, 2707, 2709, 2712, 2716, 2717, 2721, 2726, 2727,
              2729, 2730, 2731, 2732, 2733, 2734, 2735, 2737, 2740, 2741,
              2742, 2744, 2747, 2750, 2753, 2758, 2759, 2760, 2761, 2762,
              2763, 2764, 2765, 2766, 2767, 2769, 2774, 2776, 2777, 2779,
              2780, 2783, 2785, 2787, 2790, 2792, 2793, 2794, 2796, 2797,
              2799, 2800, 2802, 2803, 2807, 2810, 2819, 2823, 2825, 2826,
              2828, 2832, 2833, 2834, 2836, 2850, 2851, 2853, 2856, 2858,
              2863, 2870, 2873, 2876, 2880, 2886, 2898, 2899, 2900, 2901,
              2902, 2903, 2908, 2911, 2912, 2915, 2917, 2918, 2920, 2923,
              2926, 2932, 2933, 2934, 2935, 2936, 2937, 2938, 2943, 2947,
              2949, 2952, 2953, 2955, 2956, 2962, 2965, 2967, 2968, 2969,
              2970, 2971, 2975, 2981, 2982, 2983, 2985, 2987, 2988, 2993,
              2996, 2999
            ],
            "peaks": [
              {
                "center": 0,
                "spread": 95,
                "sites": 878,
                "log_adj_pvalue": -741.011
              }
            ]
          }, {
            "db": 1,
            "id": "CCYTGAAA",
            "alt": "DREME-3",
            "consensus": "CCYTGAAA",
            "len": 8,
            "motif_evalue": "7.5e-196",
            "motif_nsites": 967,
            "n_tested": 146,
            "score_threshold": 5,
            "pwm": [
              [2.87457e-05, 0.99992, 2.29552e-05, 2.87457e-05], 
              [2.87457e-05, 0.99992, 2.29552e-05, 2.87457e-05], 
              [2.87457e-05, 0.60906, 2.29552e-05, 0.390888], 
              [2.87457e-05, 2.29552e-05, 2.29552e-05, 0.999925], 
              [2.87457e-05, 2.29552e-05, 0.99992, 2.87457e-05], 
              [0.999925, 2.29552e-05, 2.29552e-05, 2.87457e-05], 
              [0.999925, 2.29552e-05, 2.29552e-05, 2.87457e-05], 
              [0.999925, 2.29552e-05, 2.29552e-05, 2.87457e-05]
            ],
            "total_sites": 975,
            "sites": [
              0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 2, 0, 2, 1, 0, 0,
              0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0.5, 0, 1, 0, 0, 0.5, 0, 0,
              0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.833333, 0, 0, 0,
              1, 0, 0, 0, 1.33333, 0, 0, 0, 0.333333, 0.5, 0, 1, 0, 0, 1, 0,
              0, 1, 0.5, 0.5, 1, 1, 0.5, 2, 0, 0, 0, 1.5, 2, 3.33333, 3, 2,
              3.5, 2, 2, 3.5, 2.5, 4.5, 4, 5, 6, 9.5, 7.5, 7.5, 8.5, 7, 6,
              4.5, 7, 4.5, 8, 6.5, 9, 5, 3, 9.5, 6.5, 11.5, 8, 12.5, 18,
              20.3333, 24.5, 20, 29.5, 22.8333, 8.5, 13.8333, 10, 13, 10, 9,
              13, 3, 7.5, 3, 10.3333, 2.5, 3, 4, 1, 2, 2, 1, 2, 0, 1, 2, 4, 4,
              3, 3, 6, 4, 3, 2, 2, 6, 6, 5.33333, 7, 7.33333, 10, 9.5, 8, 9,
              8.5, 13, 17.5, 19, 19, 20, 22, 31, 25.5, 16.5, 17, 14, 10.5, 4,
              6, 3, 8, 7, 5, 4.5, 3.5, 9, 4, 7.5, 5, 5.5, 9.33333, 6, 12, 6.5,
              3.33333, 7.5, 3, 3, 2, 4.5, 4.5, 3.5, 7.5, 0, 2, 0.333333, 1, 0,
              0, 0, 0, 0, 1, 3, 0, 0, 0, 0.5, 0.5, 1, 1, 0, 0, 0, 0, 0.666667,
              0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1.5, 1, 1, 1, 0, 0, 0, 1, 0,
              0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
              0, 0, 1, 1, 0.5, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 1,
              0, 0
            ],
            "seqs": [
              8, 22, 82, 98, 124, 127, 146, 163, 179, 203, 216, 218, 225, 230,
              233, 242, 246, 278, 289, 295, 300, 318, 322, 330, 331, 333, 341,
              352, 353, 357, 371, 375, 383, 384, 393, 396, 399, 400, 401, 410,
              417, 419, 430, 448, 449, 482, 494, 498, 499, 539, 540, 566, 574,
              585, 587, 592, 593, 595, 596, 597, 598, 601, 604, 606, 615, 616,
              624, 632, 633, 634, 635, 637, 639, 655, 656, 668, 672, 677, 681,
              686, 704, 705, 711, 714, 717, 719, 721, 724, 726, 729, 743, 752,
              762, 769, 776, 779, 788, 792, 801, 807, 832, 834, 841, 845, 846,
              849, 850, 851, 852, 853, 854, 861, 876, 881, 884, 885, 890, 893,
              894, 897, 902, 904, 908, 909, 924, 925, 926, 927, 932, 933, 942,
              944, 953, 955, 961, 965, 973, 974, 975, 977, 983, 985, 988, 996,
              1004, 1007, 1020, 1022, 1023, 1024, 1025, 1027, 1029, 1039,
              1041, 1048, 1051, 1053, 1063, 1065, 1066, 1071, 1073, 1074,
              1076, 1079, 1080, 1084, 1088, 1089, 1091, 1092, 1094, 1097,
              1100, 1101, 1106, 1108, 1110, 1113, 1114, 1116, 1117, 1120,
              1121, 1122, 1123, 1124, 1125, 1127, 1130, 1134, 1140, 1151,
              1152, 1153, 1154, 1162, 1172, 1174, 1180, 1181, 1182, 1189,
              1193, 1194, 1203, 1208, 1209, 1215, 1220, 1222, 1223, 1228,
              1236, 1239, 1240, 1243, 1244, 1245, 1251, 1263, 1266, 1268,
              1270, 1276, 1279, 1280, 1281, 1282, 1287, 1292, 1293, 1297,
              1303, 1305, 1309, 1311, 1313, 1316, 1324, 1328, 1331, 1335,
              1340, 1342, 1348, 1350, 1351, 1353, 1354, 1355, 1356, 1357,
              1358, 1359, 1363, 1364, 1365, 1366, 1370, 1371, 1373, 1374,
              1377, 1379, 1380, 1386, 1390, 1392, 1393, 1397, 1401, 1403,
              1407, 1410, 1413, 1417, 1419, 1421, 1422, 1423, 1425, 1430,
              1432, 1437, 1443, 1444, 1445, 1449, 1450, 1453, 1454, 1455,
              1457, 1468, 1469, 1470, 1471, 1472, 1479, 1481, 1482, 1483,
              1485, 1488, 1489, 1494, 1499, 1500, 1507, 1517, 1520, 1527,
              1528, 1532, 1536, 1537, 1547, 1548, 1554, 1564, 1566, 1567,
              1570, 1574, 1578, 1583, 1584, 1588, 1591, 1592, 1593, 1596,
              1597, 1598, 1599, 1600, 1601, 1605, 1607, 1608, 1610, 1612,
              1614, 1616, 1619, 1620, 1621, 1622, 1623, 1629, 1630, 1633,
              1635, 1643, 1644, 1646, 1647, 1648, 1652, 1655, 1658, 1662,
              1664, 1666, 1671, 1677, 1680, 1682, 1683, 1688, 1689, 1691,
              1693, 1703, 1704, 1705, 1709, 1710, 1711, 1718, 1719, 1720,
              1721, 1722, 1723, 1725, 1730, 1731, 1733, 1735, 1736, 1737,
              1741, 1743, 1746, 1749, 1755, 1756, 1757, 1759, 1762, 1765,
              1766, 1768, 1770, 1778, 1781, 1784, 1789, 1796, 1797, 1798,
              1801, 1802, 1804, 1811, 1818, 1821, 1826, 1837, 1839, 1841,
              1842, 1843, 1845, 1846, 1849, 1850, 1851, 1852, 1853, 1858,
              1859, 1862, 1864, 1865, 1866, 1867, 1868, 1869, 1871, 1872,
              1873, 1876, 1884, 1886, 1888, 1889, 1894, 1895, 1898, 1904,
              1915, 1916, 1917, 1928, 1930, 1933, 1938, 1939, 1940, 1941,
              1951, 1952, 1956, 1959, 1962, 1963, 1970, 1974, 1977, 1986,
              1987, 1989, 1996, 1997, 1999, 2003, 2004, 2005, 2006, 2008,
              2010, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2021,
              2022, 2023, 2024, 2025, 2029, 2031, 2032, 2034, 2036, 2044,
              2049, 2052, 2053, 2055, 2058, 2060, 2062, 2066, 2074, 2077,
              2078, 2080, 2081, 2082, 2086, 2089, 2090, 2091, 2092, 2093,
              2098, 2100, 2101, 2104, 2108, 2109, 2113, 2114, 2115, 2116,
              2123, 2124, 2125, 2126, 2127, 2129, 2131, 2135, 2136, 2138,
              2139, 2140, 2143, 2147, 2148, 2149, 2150, 2151, 2152, 2154,
              2155, 2160, 2161, 2163, 2164, 2167, 2168, 2169, 2171, 2173,
              2174, 2175, 2177, 2179, 2180, 2181, 2182, 2183, 2185, 2187,
              2188, 2190, 2195, 2196, 2200, 2202, 2204, 2208, 2210, 2214,
              2216, 2221, 2222, 2223, 2224, 2227, 2229, 2233, 2235, 2236,
              2238, 2240, 2247, 2257, 2258, 2260, 2261, 2262, 2263, 2265,
              2266, 2268, 2272, 2273, 2277, 2282, 2284, 2285, 2286, 2287,
              2288, 2290, 2291, 2292, 2293, 2294, 2295, 2299, 2300, 2301,
              2303, 2304, 2305, 2306, 2307, 2308, 2309, 2311, 2314, 2316,
              2318, 2324, 2328, 2332, 2333, 2334, 2335, 2338, 2339, 2344,
              2345, 2353, 2359, 2361, 2363, 2364, 2365, 2368, 2373, 2376,
              2378, 2383, 2384, 2385, 2390, 2391, 2392, 2401, 2403, 2409,
              2411, 2413, 2416, 2419, 2421, 2423, 2425, 2426, 2430, 2435,
              2436, 2437, 2438, 2439, 2441, 2442, 2445, 2447, 2448, 2449,
              2452, 2453, 2454, 2455, 2456, 2457, 2458, 2459, 2466, 2467,
              2468, 2470, 2471, 2472, 2479, 2480, 2485, 2486, 2487, 2488,
              2491, 2493, 2497, 2502, 2503, 2504, 2506, 2507, 2509, 2510,
              2511, 2512, 2523, 2525, 2526, 2529, 2530, 2533, 2543, 2547,
              2550, 2559, 2563, 2568, 2569, 2572, 2573, 2575, 2577, 2579,
              2581, 2582, 2583, 2584, 2586, 2587, 2588, 2589, 2593, 2594,
              2595, 2596, 2598, 2599, 2600, 2601, 2602, 2606, 2607, 2612,
              2613, 2618, 2624, 2625, 2627, 2629, 2630, 2632, 2634, 2636,
              2639, 2640, 2641, 2647, 2648, 2649, 2651, 2652, 2654, 2655,
              2657, 2662, 2666, 2671, 2672, 2674, 2676, 2677, 2679, 2680,
              2683, 2684, 2687, 2689, 2690, 2692, 2696, 2698, 2699, 2700,
              2703, 2707, 2709, 2712, 2717, 2721, 2726, 2727, 2728, 2729,
              2730, 2731, 2732, 2734, 2735, 2737, 2739, 2741, 2742, 2743,
              2744, 2747, 2751, 2753, 2756, 2757, 2759, 2760, 2761, 2763,
              2764, 2765, 2766, 2767, 2774, 2776, 2777, 2778, 2779, 2780,
              2783, 2785, 2787, 2788, 2790, 2792, 2793, 2794, 2796, 2797,
              2799, 2800, 2802, 2803, 2809, 2810, 2812, 2817, 2819, 2823,
              2825, 2826, 2827, 2828, 2832, 2833, 2836, 2842, 2847, 2849,
              2850, 2851, 2853, 2854, 2858, 2859, 2863, 2866, 2870, 2873,
              2886, 2898, 2899, 2900, 2901, 2902, 2903, 2907, 2908, 2912,
              2913, 2915, 2917, 2918, 2920, 2921, 2923, 2925, 2926, 2927,
              2932, 2934, 2935, 2936, 2937, 2938, 2941, 2943, 2946, 2947,
              2949, 2951, 2952, 2955, 2956, 2958, 2962, 2964, 2965, 2967,
              2968, 2969, 2970, 2971, 2975, 2976, 2981, 2982, 2985, 2988,
              2993, 2996, 2997, 2999
            ],
            "peaks": [
              {
                "center": 0,
                "spread": 117,
                "sites": 919,
                "log_adj_pvalue": -655.705
              }
            ]
          }, {
            "db": 1,
            "id": "ARRATTTA",
            "alt": "DREME-4",
            "consensus": "AARATTTA",
            "len": 8,
            "motif_evalue": "6.8e-194",
            "motif_nsites": 971,
            "n_tested": 146,
            "score_threshold": 5,
            "pwm": [
              [0.999926, 2.28607e-05, 2.28607e-05, 2.86273e-05], 
              [0.678641, 2.28607e-05, 0.321308, 2.86273e-05], 
              [0.651866, 2.28607e-05, 0.348082, 2.86273e-05], 
              [0.999926, 2.28607e-05, 2.28607e-05, 2.86273e-05], 
              [2.86273e-05, 2.28607e-05, 2.28607e-05, 0.999926], 
              [2.86273e-05, 2.28607e-05, 2.28607e-05, 0.999926], 
              [2.86273e-05, 2.28607e-05, 2.28607e-05, 0.999926], 
              [0.999926, 2.28607e-05, 2.28607e-05, 2.86273e-05]
            ],
            "total_sites": 966,
            "sites": [
              2, 2, 4, 3, 0.5, 1, 1, 0, 1, 1, 1, 1.5, 1, 0, 1, 1, 2, 1.5, 0,
              0, 1, 0, 2, 3, 0, 1, 0, 1, 0, 1, 1.5, 0, 1, 0, 2.5, 0, 0.5, 0.5,
              0, 0.5, 0, 0, 0, 0, 1, 0, 2, 0, 0.5, 1.5, 0, 5.5, 3.5, 2.5, 1.5,
              4, 4, 1, 1, 0.5, 2, 0, 1, 2, 1.5, 3, 1, 0, 2, 2, 1.5, 1, 1.5, 0,
              1, 2, 2, 1, 2.5, 2, 3, 1.5, 2, 3, 2, 1, 0, 1, 1, 2, 1, 1, 3, 0,
              2, 2, 0, 2, 1.5, 1, 3, 2, 2, 1, 2, 2, 3.5, 2.5, 3, 2.5, 3, 3, 1,
              2, 1, 5.5, 4.5, 3, 9, 7, 5.5, 8.5, 5.5, 9.5, 9.5, 12, 14.5,
              10.5, 10.5, 19.5, 22.5, 20, 27.5, 19, 14.5, 15.5, 5.5, 9, 12.5,
              9, 8.5, 8, 5.5, 3, 5, 6, 11, 6, 7, 8, 5.5, 4, 8, 6, 9, 3.5, 10,
              14, 11.5, 16.5, 10, 11, 10.5, 23, 16.5, 14.5, 16.5, 20.5, 7.5,
              12.5, 8, 9.5, 11, 13.5, 13.5, 3.5, 4, 4, 8.5, 1, 3, 1, 1, 1.5,
              1, 1, 2, 1, 1, 2, 0, 2, 1, 1, 5, 0, 0, 1, 1, 3, 1, 0, 1, 1, 1,
              0, 0, 1, 0, 1, 1, 2, 0.5, 2, 0, 2, 0.5, 2, 0.5, 1, 1, 1, 3, 1,
              0, 2.5, 1, 1, 0, 2, 0.5, 1, 1, 1, 1.5, 1.5, 0, 1, 1.5, 3, 0.5,
              2.5, 4, 2, 1.5, 1, 1, 2.5, 2.5, 2, 3.5, 1, 1, 0, 0.5, 2, 3, 0,
              1, 0, 0.5, 1, 2.5, 1, 0, 2, 1.5, 0, 2, 0, 2, 1, 1.5, 1, 0, 0, 0,
              2, 0, 0, 1, 1, 3, 3, 1, 2, 0, 1.5, 3, 0, 0, 0, 5
            ],
            "seqs": [
              4, 82, 146, 200, 230, 242, 246, 278, 289, 295, 300, 314, 318,
              330, 336, 337, 341, 344, 353, 357, 374, 389, 393, 401, 408, 419,
              448, 482, 499, 502, 536, 562, 566, 574, 584, 592, 593, 604, 606,
              616, 617, 624, 634, 635, 646, 672, 681, 701, 705, 711, 712, 714,
              717, 719, 726, 729, 762, 771, 776, 779, 792, 800, 806, 807, 836,
              841, 845, 847, 849, 850, 851, 853, 855, 861, 876, 881, 885, 890,
              894, 906, 909, 925, 926, 932, 942, 946, 953, 961, 965, 969, 974,
              983, 990, 1004, 1010, 1012, 1020, 1022, 1029, 1039, 1041, 1043,
              1048, 1065, 1071, 1073, 1076, 1077, 1079, 1080, 1088, 1089,
              1091, 1101, 1104, 1106, 1108, 1113, 1116, 1117, 1120, 1121,
              1124, 1140, 1142, 1153, 1154, 1162, 1174, 1193, 1196, 1203,
              1208, 1209, 1220, 1223, 1238, 1243, 1244, 1245, 1263, 1268,
              1270, 1276, 1280, 1281, 1282, 1292, 1293, 1297, 1298, 1303,
              1305, 1306, 1316, 1324, 1328, 1329, 1340, 1342, 1348, 1350,
              1351, 1354, 1355, 1358, 1361, 1362, 1364, 1365, 1366, 1367,
              1370, 1374, 1377, 1380, 1386, 1389, 1390, 1397, 1399, 1401,
              1403, 1407, 1410, 1412, 1413, 1417, 1419, 1423, 1425, 1426,
              1430, 1432, 1437, 1442, 1444, 1445, 1450, 1453, 1454, 1457,
              1469, 1470, 1471, 1479, 1482, 1483, 1485, 1488, 1489, 1495,
              1500, 1501, 1507, 1517, 1520, 1527, 1528, 1532, 1536, 1537,
              1554, 1555, 1564, 1565, 1566, 1567, 1569, 1570, 1574, 1576,
              1578, 1581, 1583, 1584, 1587, 1591, 1592, 1594, 1595, 1596,
              1599, 1600, 1601, 1606, 1607, 1608, 1610, 1612, 1616, 1619,
              1620, 1629, 1630, 1633, 1635, 1646, 1647, 1648, 1652, 1662,
              1664, 1670, 1671, 1677, 1682, 1683, 1688, 1703, 1705, 1709,
              1710, 1712, 1718, 1719, 1722, 1725, 1730, 1731, 1735, 1736,
              1737, 1740, 1741, 1742, 1743, 1746, 1756, 1757, 1762, 1765,
              1768, 1770, 1778, 1784, 1789, 1796, 1797, 1798, 1801, 1802,
              1804, 1837, 1843, 1844, 1845, 1846, 1850, 1852, 1853, 1862,
              1864, 1865, 1868, 1872, 1876, 1880, 1886, 1888, 1894, 1895,
              1898, 1910, 1911, 1915, 1916, 1917, 1919, 1921, 1923, 1929,
              1933, 1938, 1940, 1952, 1956, 1959, 1962, 1963, 1970, 1974,
              1987, 1989, 1995, 1996, 2000, 2003, 2004, 2006, 2014, 2015,
              2019, 2021, 2024, 2029, 2031, 2032, 2033, 2034, 2043, 2049,
              2053, 2055, 2058, 2066, 2074, 2077, 2080, 2081, 2086, 2089,
              2091, 2093, 2098, 2109, 2113, 2114, 2116, 2124, 2125, 2131,
              2133, 2135, 2136, 2138, 2140, 2144, 2146, 2147, 2148, 2149,
              2150, 2152, 2155, 2160, 2161, 2162, 2163, 2164, 2165, 2167,
              2169, 2171, 2173, 2174, 2175, 2179, 2181, 2182, 2183, 2185,
              2188, 2190, 2195, 2196, 2202, 2204, 2210, 2212, 2213, 2214,
              2215, 2218, 2221, 2223, 2224, 2227, 2233, 2236, 2238, 2247,
              2258, 2261, 2265, 2266, 2268, 2272, 2273, 2282, 2284, 2285,
              2287, 2288, 2290, 2292, 2294, 2300, 2301, 2302, 2304, 2305,
              2306, 2310, 2314, 2316, 2318, 2319, 2324, 2328, 2332, 2333,
              2338, 2339, 2344, 2345, 2348, 2359, 2361, 2363, 2364, 2365,
              2367, 2373, 2378, 2383, 2384, 2390, 2392, 2396, 2404, 2406,
              2408, 2409, 2413, 2419, 2421, 2423, 2436, 2438, 2439, 2441,
              2442, 2445, 2447, 2449, 2452, 2453, 2454, 2456, 2457, 2459,
              2466, 2467, 2470, 2471, 2485, 2486, 2487, 2490, 2491, 2493,
              2497, 2503, 2506, 2510, 2511, 2512, 2526, 2529, 2530, 2533,
              2543, 2545, 2547, 2550, 2559, 2572, 2573, 2577, 2579, 2583,
              2584, 2585, 2586, 2587, 2588, 2589, 2593, 2596, 2599, 2606,
              2612, 2618, 2624, 2625, 2626, 2629, 2630, 2631, 2632, 2636,
              2639, 2640, 2641, 2642, 2648, 2657, 2662, 2667, 2671, 2675,
              2679, 2683, 2687, 2690, 2696, 2699, 2700, 2703, 2706, 2709,
              2711, 2712, 2716, 2717, 2718, 2726, 2728, 2730, 2731, 2735,
              2738, 2740, 2742, 2743, 2751, 2754, 2757, 2760, 2762, 2763,
              2764, 2766, 2777, 2778, 2780, 2787, 2793, 2794, 2800, 2803,
              2817, 2823, 2825, 2826, 2834, 2844, 2847, 2851, 2853, 2854,
              2859, 2866, 2898, 2899, 2900, 2902, 2903, 2907, 2909, 2911,
              2913, 2917, 2920, 2921, 2923, 2925, 2933, 2934, 2937, 2938,
              2941, 2943, 2945, 2946, 2949, 2951, 2953, 2955, 2962, 2964,
              2965, 2969, 2970, 2975, 2976, 2979, 2981, 2982, 2985, 2988,
              2993, 2996, 2997, 2999
            ],
            "peaks": [
              {
                "center": 0,
                "spread": 57,
                "sites": 630.5,
                "log_adj_pvalue": -479.472
              }
            ]
          }, {
            "db": 1,
            "id": "GACCYACC",
            "alt": "DREME-5",
            "consensus": "GACCCACC",
            "len": 8,
            "motif_evalue": "1.0e-168",
            "motif_nsites": 638,
            "n_tested": 146,
            "score_threshold": 5,
            "pwm": [
              [4.35668e-05, 3.47908e-05, 0.999878, 4.35668e-05], 
              [0.999887, 3.47908e-05, 3.47908e-05, 4.35668e-05], 
              [4.35668e-05, 0.999878, 3.47908e-05, 4.35668e-05], 
              [4.35668e-05, 0.999878, 3.47908e-05, 4.35668e-05], 
              [4.35668e-05, 0.863535, 3.47908e-05, 0.136386], 
              [0.999887, 3.47908e-05, 3.47908e-05, 4.35668e-05], 
              [4.35668e-05, 0.999878, 3.47908e-05, 4.35668e-05], 
              [4.35668e-05, 0.999878, 3.47908e-05, 4.35668e-05]
            ],
            "total_sites": 931,
            "sites": [
              0, 0, 0.5, 0, 0.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
              0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0.5, 0, 0,
              0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
              2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 3, 0, 1, 1, 1, 1, 0, 1,
              2, 1, 1, 5, 2, 3, 2, 3.5, 4, 4, 1, 7, 1, 4.5, 11, 8, 15.5, 11,
              11, 15, 16.5, 26, 14.5, 20, 15, 14, 15.5, 8, 9, 10, 5, 16, 5, 6,
              4, 7, 0, 3, 2, 3, 1, 2, 3, 5, 1, 2, 3, 2, 5, 2.5, 1, 4, 3, 5, 4,
              8, 5, 5, 4, 11.5, 7.5, 5.5, 10, 11.5, 10.5, 9.5, 14, 7.5, 11, 8,
              6, 6.5, 6, 5, 4.5, 4, 4, 1, 2, 5, 5.5, 1, 2, 5, 2, 1, 2, 4, 5,
              4, 0, 3, 5.5, 5, 2, 9.5, 9, 11, 10, 6, 8.5, 10, 9, 20, 15.5,
              13.5, 20, 25, 20, 27.5, 13, 17, 15, 11, 3, 3, 3, 10, 3, 2, 2, 3,
              4.5, 4, 1, 2.5, 2, 1, 0, 1, 0, 3, 0, 1, 0, 0, 2, 1, 0, 0, 0, 1,
              0, 1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0.5, 0, 0, 0, 1, 1, 0, 0, 0, 1,
              0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0.5, 0, 0, 0,
              0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0,
              0, 0, 0, 0, 0
            ],
            "seqs": [
              22, 27, 82, 98, 124, 128, 133, 140, 142, 144, 146, 163, 168,
              194, 203, 218, 225, 230, 233, 242, 246, 271, 278, 295, 300, 322,
              330, 337, 341, 347, 352, 353, 366, 371, 374, 375, 384, 393, 399,
              400, 401, 408, 410, 419, 430, 431, 448, 449, 494, 498, 499, 514,
              539, 540, 544, 552, 562, 574, 585, 595, 596, 597, 598, 601, 604,
              615, 616, 619, 624, 626, 631, 632, 633, 635, 639, 646, 655, 656,
              668, 672, 677, 681, 682, 686, 689, 701, 703, 705, 711, 712, 714,
              717, 719, 723, 726, 743, 752, 757, 771, 776, 779, 792, 800, 807,
              832, 834, 841, 846, 849, 850, 852, 854, 855, 861, 876, 881, 885,
              890, 897, 902, 906, 908, 924, 925, 926, 927, 931, 932, 933, 942,
              944, 955, 961, 965, 966, 969, 972, 973, 974, 975, 977, 983, 985,
              988, 996, 998, 1007, 1010, 1020, 1022, 1023, 1027, 1029, 1035,
              1041, 1048, 1050, 1051, 1053, 1058, 1065, 1066, 1073, 1076,
              1077, 1079, 1080, 1084, 1092, 1097, 1100, 1101, 1102, 1106,
              1108, 1110, 1113, 1114, 1115, 1120, 1122, 1123, 1124, 1125,
              1127, 1130, 1134, 1151, 1152, 1153, 1154, 1172, 1174, 1180,
              1182, 1184, 1193, 1194, 1197, 1209, 1210, 1215, 1220, 1222,
              1223, 1228, 1236, 1239, 1243, 1244, 1245, 1248, 1251, 1253,
              1266, 1270, 1276, 1282, 1284, 1287, 1292, 1293, 1297, 1298,
              1303, 1305, 1306, 1309, 1311, 1316, 1324, 1328, 1331, 1335,
              1340, 1342, 1343, 1348, 1350, 1351, 1352, 1353, 1354, 1355,
              1357, 1358, 1359, 1360, 1361, 1364, 1366, 1367, 1370, 1371,
              1374, 1377, 1379, 1380, 1386, 1392, 1397, 1401, 1402, 1403,
              1407, 1412, 1413, 1417, 1419, 1421, 1422, 1423, 1425, 1430,
              1431, 1432, 1442, 1443, 1444, 1445, 1449, 1450, 1453, 1454,
              1455, 1457, 1458, 1470, 1471, 1472, 1480, 1481, 1483, 1485,
              1488, 1492, 1500, 1508, 1520, 1522, 1527, 1532, 1536, 1537,
              1541, 1543, 1547, 1554, 1555, 1556, 1562, 1564, 1567, 1569,
              1570, 1576, 1578, 1583, 1584, 1588, 1591, 1592, 1593, 1594,
              1595, 1596, 1597, 1598, 1599, 1600, 1605, 1606, 1607, 1610,
              1612, 1614, 1616, 1619, 1620, 1621, 1622, 1623, 1629, 1635,
              1639, 1643, 1646, 1647, 1648, 1652, 1655, 1658, 1666, 1670,
              1671, 1677, 1680, 1688, 1689, 1691, 1703, 1704, 1705, 1706,
              1709, 1710, 1711, 1718, 1720, 1722, 1723, 1725, 1730, 1731,
              1733, 1736, 1737, 1740, 1742, 1743, 1746, 1749, 1757, 1758,
              1759, 1762, 1765, 1766, 1768, 1770, 1778, 1781, 1784, 1789,
              1796, 1797, 1798, 1801, 1802, 1804, 1811, 1818, 1821, 1826,
              1839, 1841, 1842, 1843, 1844, 1846, 1849, 1851, 1852, 1853,
              1858, 1859, 1862, 1864, 1865, 1867, 1868, 1871, 1872, 1873,
              1876, 1884, 1888, 1889, 1894, 1895, 1898, 1904, 1910, 1911,
              1915, 1916, 1917, 1919, 1922, 1923, 1929, 1933, 1937, 1939,
              1940, 1941, 1943, 1951, 1952, 1962, 1963, 1970, 1977, 1978,
              1983, 1986, 1987, 1988, 1989, 1994, 1996, 1997, 1999, 2000,
              2004, 2005, 2006, 2008, 2009, 2010, 2013, 2014, 2015, 2016,
              2018, 2021, 2022, 2024, 2025, 2029, 2031, 2032, 2044, 2049,
              2052, 2053, 2055, 2058, 2060, 2062, 2066, 2074, 2077, 2080,
              2081, 2092, 2093, 2098, 2100, 2101, 2109, 2113, 2114, 2123,
              2124, 2126, 2127, 2129, 2135, 2136, 2137, 2138, 2139, 2140,
              2143, 2144, 2147, 2148, 2149, 2150, 2151, 2152, 2153, 2154,
              2160, 2161, 2163, 2164, 2165, 2168, 2169, 2171, 2172, 2174,
              2175, 2176, 2177, 2179, 2181, 2182, 2183, 2185, 2187, 2188,
              2190, 2195, 2196, 2200, 2201, 2204, 2208, 2210, 2213, 2214,
              2215, 2216, 2218, 2221, 2223, 2224, 2229, 2233, 2238, 2240,
              2247, 2248, 2257, 2258, 2261, 2262, 2263, 2268, 2273, 2277,
              2282, 2284, 2285, 2286, 2287, 2288, 2291, 2293, 2294, 2295,
              2299, 2300, 2305, 2306, 2307, 2308, 2309, 2311, 2314, 2316,
              2318, 2322, 2324, 2326, 2328, 2332, 2333, 2334, 2335, 2338,
              2339, 2344, 2345, 2348, 2353, 2359, 2361, 2363, 2365, 2368,
              2373, 2376, 2381, 2383, 2384, 2385, 2390, 2391, 2392, 2396,
              2401, 2403, 2404, 2411, 2413, 2416, 2418, 2421, 2423, 2424,
              2425, 2426, 2430, 2435, 2436, 2437, 2438, 2439, 2441, 2442,
              2445, 2449, 2452, 2453, 2454, 2455, 2456, 2457, 2458, 2459,
              2464, 2465, 2466, 2467, 2468, 2470, 2471, 2472, 2478, 2479,
              2480, 2486, 2488, 2490, 2491, 2492, 2497, 2502, 2504, 2506,
              2509, 2511, 2523, 2525, 2529, 2530, 2532, 2533, 2543, 2547,
              2550, 2551, 2568, 2569, 2572, 2573, 2575, 2577, 2579, 2581,
              2582, 2583, 2584, 2585, 2586, 2587, 2588, 2589, 2593, 2594,
              2597, 2600, 2601, 2602, 2606, 2607, 2612, 2613, 2618, 2625,
              2626, 2627, 2628, 2629, 2631, 2632, 2634, 2636, 2639, 2640,
              2641, 2642, 2647, 2648, 2649, 2651, 2657, 2662, 2666, 2667,
              2674, 2675, 2676, 2677, 2680, 2685, 2687, 2688, 2689, 2690,
              2696, 2699, 2703, 2706, 2707, 2708, 2711, 2712, 2716, 2717,
              2718, 2721, 2725, 2727, 2728, 2729, 2731, 2732, 2733, 2734,
              2735, 2737, 2738, 2739, 2740, 2741, 2742, 2743, 2744, 2747,
              2750, 2751, 2753, 2754, 2755, 2757, 2758, 2759, 2761, 2762,
              2763, 2764, 2765, 2766, 2767, 2769, 2774, 2776, 2780, 2783,
              2785, 2787, 2788, 2790, 2793, 2794, 2796, 2797, 2799, 2800,
              2802, 2803, 2807, 2810, 2817, 2819, 2823, 2825, 2826, 2828,
              2832, 2833, 2834, 2839, 2842, 2844, 2847, 2849, 2850, 2853,
              2854, 2856, 2858, 2859, 2863, 2865, 2866, 2869, 2876, 2886,
              2898, 2899, 2900, 2901, 2902, 2903, 2905, 2908, 2911, 2912,
              2917, 2920, 2921, 2923, 2925, 2926, 2927, 2932, 2933, 2934,
              2936, 2937, 2938, 2941, 2943, 2947, 2949, 2951, 2952, 2955,
              2956, 2964, 2965, 2966, 2967, 2968, 2969, 2970, 2971, 2976,
              2979, 2982, 2985, 2987, 2988, 2993, 2996, 2997, 2999
            ],
            "peaks": [
              {
                "center": 0,
                "spread": 121,
                "sites": 879,
                "log_adj_pvalue": -602.372
              }
            ]
          }
        ]
      };
    </script>
    <script type="text/javascript">
var site_url = "http://meme-suite.org";

    </script>
    <script type="text/javascript">
/*
 * $
 *
 * Shorthand function for getElementById
 */
function $(el) {
  return document.getElementById(el);
}


/*
 * See http://stackoverflow.com/a/5450113/66387
 * Does string multiplication like the perl x operator.
 */
function string_mult(pattern, count) {
    if (count < 1) return '';
    var result = '';
    while (count > 1) {
        if (count & 1) result += pattern;
        count >>= 1, pattern += pattern;
    }
    return result + pattern;
}

/*
 * See http://stackoverflow.com/questions/814613/how-to-read-get-data-from-a-url-using-javascript
 * Slightly modified with information from
 * https://developer.mozilla.org/en/DOM/window.location
 */
function parse_params() {
  "use strict";
  var search, queryStart, queryEnd, query, params, nvPairs, i, nv, n, v;
  search = window.location.search;
  queryStart = search.indexOf("?") + 1;
  queryEnd   = search.indexOf("#") + 1 || search.length + 1;
  query      = search.slice(queryStart, queryEnd - 1);

  if (query === search || query === "") return {};

  params  = {};
  nvPairs = query.replace(/\+/g, " ").split("&");

  for (i = 0; i < nvPairs.length; i++) {
    nv = nvPairs[i].split("=");
    n  = decodeURIComponent(nv[0]);
    v  = decodeURIComponent(nv[1]);
    // allow a name to be used multiple times
    // storing each value in the array
    if (!(n in params)) {
      params[n] = [];
    }
    params[n].push(nv.length === 2 ? v : null);
  }
  return params;
}

/*
 * coords
 *
 * Calculates the x and y offset of an element.
 * From http://www.quirksmode.org/js/findpos.html
 * with alterations to take into account scrolling regions
 */
function coords(elem) {
  var myX = myY = 0;
  if (elem.getBoundingClientRect) {
    var rect;
    rect = elem.getBoundingClientRect();
    myX = rect.left + ((typeof window.pageXOffset !== "undefined") ?
        window.pageXOffset : document.body.scrollLeft);
    myY = rect.top + ((typeof window.pageYOffset !== "undefined") ?
        window.pageYOffset : document.body.scrollTop);
  } else {
    // this fall back doesn't properly handle absolutely positioned elements
    // inside a scrollable box
    var node;
    if (elem.offsetParent) {
      // subtract all scrolling
      node = elem;
      do {
        myX -= node.scrollLeft ? node.scrollLeft : 0;
        myY -= node.scrollTop ? node.scrollTop : 0;
      } while (node = node.parentNode);
      // this will include the page scrolling (which is unwanted) so add it back on
      myX += (typeof window.pageXOffset !== "undefined") ? window.pageXOffset : document.body.scrollLeft;
      myY += (typeof window.pageYOffset !== "undefined") ? window.pageYOffset : document.body.scrollTop;
      // sum up offsets
      node = elem;
      do {
        myX += node.offsetLeft;
        myY += node.offsetTop;
      } while (node = node.offsetParent);
    }
  }
  return [myX, myY];
}

/*
 * position_popup
 *
 * Positions a popup relative to an anchor element.
 *
 * The available positions are:
 * 0 - Centered below the anchor.
 */
function position_popup(anchor, popup, position) {
  "use strict";
  var a_x, a_y, a_w, a_h, p_x, p_y, p_w, p_h;
  var a_xy, spacer, margin, scrollbar, page_w;
  // define constants
  spacer = 5;
  margin = 15;
  scrollbar = 15;
  // define the positions and widths
  a_xy = coords(anchor);
  a_x = a_xy[0];
  a_y = a_xy[1];
  a_w = anchor.offsetWidth;
  a_h = anchor.offsetHeight;
  p_w = popup.offsetWidth;
  p_h = popup.offsetHeight;
  page_w = null;
  if (window.innerWidth) {
    page_w = window.innerWidth;
  } else if (document.body) {
    page_w = document.body.clientWidth;
  }
  // check the position type is defined
  if (typeof position !== "number") {
    position = 0;
  }
  // calculate the popup position
  switch (position) {
    case 1:
      p_x = a_x + a_w + spacer;
      p_y = a_y + (a_h / 2) - (p_h / 2);
      break;
    case 0:
    default:
      p_x = a_x + (a_w / 2) - (p_w / 2);
      p_y = a_y + a_h + spacer;
      break;
  }
  // constrain the popup position
  if (p_x < margin) {
    p_x = margin;
  } else if (page_w != null && (p_x + p_w) > (page_w - margin - scrollbar)) {
    p_x = page_w - margin - scrollbar - p_w;
  }
  if (p_y < margin) {
    p_y = margin;
  }
  // position the popup
  popup.style.left = p_x + "px";
  popup.style.top = p_y + "px";
}

function lookup_help_popup(popup_id) {
  var _body, pop, info;
  pop = document.getElementById(popup_id);
  if (pop == null) {
    _body = document.getElementsByTagName("body")[0];
    pop = document.createElement("div");
    pop.className = "pop_content";
    pop.id = popup_id;
    pop.style.backgroundColor = "#FFC";
    pop.style.borderColor = "black";
    info = document.createElement("p");
    info.style.fontWeight = "bold";
    info.appendChild(document.createTextNode("Error: No popup for topic \"" + popup_id + "\"."));
    pop.appendChild(info);
    // this might cause problems with the menu, but as this only happens
    // when something is already wrong I don't think that's too much of a problem
    _body.insertBefore(pop, _body.firstChild);
  }
  if (document.getElementsByTagName('body')[0].hasAttribute("data-autobtns")) {
    if (!/\bauto_buttons\b/.test(pop.className)) {
      pop.className += " auto_buttons";
      var back_btn_sec = document.createElement("div");
      back_btn_sec.className = "nested_only pop_back_sec";
      var back_btn = document.createElement("span");
      back_btn.className = "pop_back";
      back_btn.appendChild(document.createTextNode("<< back"));
      back_btn.addEventListener("click", function(e) {
        help_return();
      }, false);
      back_btn_sec.appendChild(back_btn);
      pop.insertBefore(back_btn_sec, pop.firstChild);
      var close_btn_sec = document.createElement("div");
      close_btn_sec.className = "pop_close_sec";
      var close_btn = document.createElement("span");
      close_btn.className = "pop_close";
      close_btn.appendChild(document.createTextNode("close"));
      close_btn.addEventListener("click", function(e) {
        help_popup();
      }, false);
      close_btn_sec.appendChild(close_btn);
      pop.appendChild(close_btn_sec);
    }
  }
  return pop;
}

/*
 * help_popup
 *
 * Moves around help pop-ups so they appear
 * below an activator.
 */
function help_popup(activator, popup_id) {
  "use strict";
  var pop;
  // set default values
  if (typeof help_popup.popup === "undefined") {
    help_popup.popup = [];
  }
  if (typeof help_popup.activator === "undefined") {
    help_popup.activator = null;
  }
  var last_pop = (help_popup.popup.length > 0 ? help_popup.popup[help_popup.popup.length - 1] : null);
  if (typeof(activator) == "undefined") { // no activator so hide
    if (last_pop != null) {
      last_pop.style.display = 'none';
      help_popup.popup = [];
    }
    return;
  }
  pop = lookup_help_popup(popup_id);
  if (pop == last_pop) {
    if (activator == help_popup.activator) {
      //hide popup (as we've already shown it for the current help button)
      last_pop.style.display = 'none';
      help_popup.popup = [];
      return; // toggling complete!
    }
  } else if (last_pop != null) {
    //activating different popup so hide current one
    last_pop.style.display = 'none';
  }
  help_popup.popup = [pop];
  help_popup.activator = activator;
  toggle_class(pop, "nested", false);
  //must make the popup visible to measure it or it has zero width
  pop.style.display = 'block';
  position_popup(activator, pop);
}

/*
 * help_refine
 * 
 * Intended for links within a help popup. Stores a stack of state so
 * you can go back.
 */
function help_refine(popup_id) {
  if (help_popup.popup == null || help_popup.popup.length == 0 || help_popup.activator == null) {
    //throw new Error("Cannot refine a help popup when one is not shown!");
    var pop = lookup_help_popup(popup_id);
    var act_id = popup_id + '_act';
    var activator = document.getElementById(act_id);
    help_popup(activator, popup_id);
  }
  var pop = lookup_help_popup(popup_id);
  var last_pop = help_popup.popup[help_popup.popup.length - 1];
  if (pop == last_pop) return; // slightly odd, but no real cause for alarm
  help_popup.popup.push(pop);
  toggle_class(pop, "nested", true);
  last_pop.style.display = "none";
  //must make the popup visible to measure it or it has zero width
  pop.style.display = "block";
  position_popup(help_popup.activator, pop);
}

/*
 * help_return
 * 
 * Intended for links within a help popup. Stores a stack of state so
 * you can go back.
 */
function help_return() {
  if (help_popup.popup == null || help_popup.popup.length == 0 || help_popup.activator == null) {
    throw new Error("Can not return to a earlier help popup when one is not shown!");
  }
  var last_pop = help_popup.popup.pop();
  last_pop.style.display = "none";
  var pop = (help_popup.popup.length > 0 ? help_popup.popup[help_popup.popup.length - 1] : null);
  if (pop != null) {
    toggle_class(pop, "nested", help_popup.popup.length > 1);
    pop.style.display = "block";
    position_popup(help_popup.activator, pop);
  } else {
    help_popup.activator = null;
  }
}

/*
 * update_scroll_pad
 *
 * Creates padding at the bottom of the page to allow
 * scrolling of anything into view.
 */
function update_scroll_pad() {
  var page, pad;
  page = (document.compatMode === "CSS1Compat") ? document.documentElement : document.body;
  pad = $("scrollpad");
  if (pad === null) {
    pad = document.createElement("div");
    pad.id = 'scrollpad';
    document.getElementsByTagName('body')[0].appendChild(pad);
  }
  pad.style.height = Math.abs(page.clientHeight - 100) + "px";
}

function substitute_classes(node, remove, add) {
  "use strict";
  var list, all, i, cls, classes;
  list = node.className.split(/\s+/);
  all = {};
  for (i = 0; i < list.length; i++) {
    if (list[i].length > 0) all[list[i]] = true;
  }
  for (i = 0; i < remove.length; i++) {
    if (all.hasOwnProperty(remove[i])) {
      delete all[remove[i]];
    }
  }
  for (i = 0; i < add.length; i++) {
    all[add[i]] = true;
  }
  classes = "";
  for (cls in all) {
    classes += cls + " ";
  }
  node.className = classes;
}

/*
 * toggle_class
 *
 * Adds or removes a class from the node. If the parameter 'enabled' is not 
 * passed then the existence of the class will be toggled, otherwise it will be
 * included if enabled is true.
 */
function toggle_class(node, cls, enabled) {
  var classes = node.className;
  var list = classes.replace(/^\s+/, '').replace(/\s+$/, '').split(/\s+/);
  var found = false;
  for (var i = 0; i < list.length; i++) {
    if (list[i] == cls) {
      list.splice(i, 1);
      i--;
      found = true;
    }
  }
  if (typeof enabled == "undefined") {
    if (!found) list.push(cls);
  } else {
    if (enabled) list.push(cls);
  }
  node.className = list.join(" ");
}

/*
 * find_child
 *
 * Searches child nodes in depth first order and returns the first it finds
 * with the className specified.
 * TODO replace with querySelector
 */
function find_child(node, className) {
  var pattern;
  if (node == null || typeof node !== "object") {
    return null;
  }
  if (typeof className === "string") {
    pattern = new RegExp("\\b" + className + "\\b");
  } else {
    pattern = className;
  }
  if (node.nodeType == Node.ELEMENT_NODE && 
      pattern.test(node.className)) {
    return node;
  } else {
    var result = null;
    for (var i = 0; i < node.childNodes.length; i++) {
      result = find_child(node.childNodes[i], pattern);
      if (result != null) break;
    }
    return result;
  }
}

/*
 * find_parent
 *
 * Searches parent nodes outwards from the node and returns the first it finds
 * with the className specified.
 */
function find_parent(node, className) {
  var pattern;
  pattern = new RegExp("\\b" + className + "\\b");
  do {
    if (node.nodeType == Node.ELEMENT_NODE && 
        pattern.test(node.className)) {
      return node;
    }
  } while (node = node.parentNode);
  return null;
}

/*
 * find_parent_tag
 *
 * Searches parent nodes outwards from the node and returns the first it finds
 * with the tag name specified. HTML tags should be specified in upper case.
 */
function find_parent_tag(node, tag_name) {
  do {
    if (node.nodeType == Node.ELEMENT_NODE && node.tagName == tag_name) {
      return node;
    }
  } while (node = node.parentNode);
  return null;
}

/*
 * __toggle_help
 *
 * Uses the 'topic' property of the this object to
 * toggle display of a help topic.
 *
 * This function is not intended to be called directly.
 */
function __toggle_help(e) {
  if (!e) e = window.event;
  if (e.type === "keydown") {
    if (e.keyCode !== 13 && e.keyCode !== 32) {
      return;
    }
    // stop a submit or something like that
    e.preventDefault();
  }

  help_popup(this, this.getAttribute("data-topic"));
}

function setup_help_button(button) {
  "use strict";
  var topic;
  if (button.hasAttribute("data-topic")) {
    topic = button.getAttribute("data-topic");
    if (document.getElementById(topic) != null) {
      button.tabIndex = "0"; // make keyboard selectable
      button.addEventListener("click", function() {
        help_popup(button, topic);
      }, false);
      button.addEventListener("keydown", function(e) {
        // toggle only on Enter or Spacebar, let other keys do their thing
        if (e.keyCode !== 13 && e.keyCode !== 32) return;
        // stop a submit or something like that
        e.preventDefault();
        help_popup(button, topic);
      }, false);
    } else {
      button.style.visibility = "hidden";
    }
  }
  button.className += " active";
}

/*
 * help_button
 *
 * Makes a help button for the passed topic.
 */
function help_button(topic) {
  var btn = document.createElement("div");
  btn.className = "help";
  btn.setAttribute("data-topic", topic);
  setup_help_button(btn);
  return btn;
}

/*
 * prepare_download
 *
 * Sets the attributes of a link to setup a file download using the given content.
 * If no link is provided then create one and click it.
 */
function prepare_download(content, mimetype, filename, link) {
  "use strict";
  // if no link is provided then create one and click it
  var click_link = false;
  if (!link) {
    link = document.createElement("a");
    click_link = true;
  }
  try {
    // Use a BLOB to convert the text into a data URL.
    // We could do this manually with a base 64 conversion.
    // This will only be supported on modern browsers,
    // hence the try block.
    var blob = new Blob([content], {type: mimetype});
    var reader = new FileReader();
    reader.onloadend = function() {
      // If we're lucky the browser will also support the download
      // attribute which will let us suggest a file name to save the link.
      // Otherwise it is likely that the filename will be unintelligible. 
      link.setAttribute("download", filename);
      link.href = reader.result;
      if (click_link) {
        // must add the link to click it
        document.body.appendChild(link);
        link.click();
        document.body.removeChild(link);
      }
    }
    reader.readAsDataURL(blob);
  } catch (error) {
    if (console && console.log) console.log(error);
    // probably an old browser
    link.href = "";
    link.visible = false;
  }
}

/*
 * add_cell
 *
 * Add a cell to the table row.
 */
function add_cell(row, node, cls, click_action) {
  var cell = row.insertCell(row.cells.length);
  if (node) cell.appendChild(node);
  if (cls && cls !== "") cell.className = cls;
  if (click_action) cell.addEventListener("click", click_action, false);
}

/*
 * add_header_cell
 *
 * Add a header cell to the table row.
 */
function add_header_cell(row, node, help_topic, cls, colspan) {
  var th = document.createElement("th");
  if (node) th.appendChild(node);
  if (help_topic && help_topic !== "") th.appendChild(help_button(help_topic));
  if (cls && cls !== "") th.className = cls;
  if (typeof colspan == "number" && colspan > 1) th.colSpan = colspan;
  row.appendChild(th);
}

/*
 * add_text_cell
 *
 * Add a text cell to the table row.
 */
function add_text_cell(row, text, cls, action) {
  var node = null;
  if (typeof(text) != 'undefined') node = document.createTextNode(text);
  add_cell(row, node, cls, action);
}

/*
 * add_text_header_cell
 *
 * Add a text header cell to the table row.
 */
function add_text_header_cell(row, text, help_topic, cls, action, colspan) {
  var node = null;
  if (typeof(text) != 'undefined') {
    var nbsp = (help_topic ? "\u00A0" : "");
    var str = "" + text;
    var parts = str.split(/\n/);
    if (parts.length === 1) {
      if (action) {
        node = document.createElement("span");
        node.appendChild(document.createTextNode(str + nbsp));
      } else {
        node = document.createTextNode(str + nbsp);
      }
    } else {
      node = document.createElement("span");
      for (var i = 0; i < parts.length; i++) {
        if (i !== 0) {
          node.appendChild(document.createElement("br"));
        }
        node.appendChild(document.createTextNode(parts[i]));
      }
    }
    if (action) {
      node.addEventListener("click", action, false);
      node.style.cursor = "pointer";
    }
  }
  add_header_cell(row, node, help_topic, cls, colspan);
}

function setup_help() {
  "use strict";
  var help_buttons, i;
  help_buttons = document.querySelectorAll(".help:not(.active)");
  for (i = 0; i < help_buttons.length; i++) {
    setup_help_button(help_buttons[i]);
  }
}

function setup_scrollpad() {
  "use strict";
  if (document.getElementsByTagName('body')[0].hasAttribute("data-scrollpad") && document.getElementById("scrollpad") == null) {
    window.addEventListener("resize", update_scroll_pad, false);
    update_scroll_pad();
  }
}

// anon function to avoid polluting global scope
(function() {
  "use strict";
  window.addEventListener("load", function load(evt) {
    window.removeEventListener("load", load, false);
    setup_help();
    setup_scrollpad();
  }, false);
})();

/*
 *  make_link
 *
 *  Creates a text node and if a URL is specified it surrounds it with a link.
 *  If the URL doesn't begin with "http://" it automatically adds it, as
 *  relative links don't make much sense in this context.
 */
function make_link(text, url) {
  var textNode = null;
  var link = null;
  if (typeof text !== "undefined" && text !== null) textNode = document.createTextNode(text);
  if (typeof url === "string") {
    if (url.indexOf("//") == -1) {
      url = "http://" + url;
    }
    link = document.createElement('a');
    link.href = url;
    if (textNode) link.appendChild(textNode);
    return link;
  }
  return textNode;
}

//
// Function to create an HTML paragraph describing the 
// MEME Suite background model source.
//
function make_background_source(title, source, text) {
  var paraNode = document.createElement("P");
  var titleNode = document.createElement("B");
  var textNode1 = document.createTextNode("\u00A0\u00A0\u00A0\u00A0" + title + ": ");
  titleNode.appendChild(textNode1);
  var source_text = ((source == "--motif--") ? "the (first) motif file" : (source == "--nrdb--") ? "an old version of the NCBI non-redundant database" : (source == "--uniform--") ? "the uniform model" : (source == "--query--") ? "the query file" : (source == "--sequences--") ? "built from the (primary) sequences" : ("the file '" + source + "'"));
  if (text) { return source_text; }
  var textNode2 = document.createTextNode(source_text);
  paraNode.appendChild(titleNode);
  paraNode.appendChild(textNode2);
  return paraNode;
}

// Function to create a help button
function make_help_button(container, help_topic) {
  container.appendChild(help_button(help_topic));
}

    </script>
    <script type="text/javascript">
function rad2deg(rad) {
  return rad * 180 / Math.PI;
}

function parse_line_join(line_join) {
  line_join = line_join.toLowerCase();
  if (line_join == "bevel") {
    return 2;
  } else if (line_join == "round") {
    return 1;
  } else { // miter
    return 0;
  }
}

function parse_line_cap(line_cap) {
  line_cap = line_cap.toLowerCase();
  if (line_cap == "square") {
    return 2;
  } else if (line_cap == "round") {
    return 1;
  } else { // butt 
    return 0;
  }
}

function parse_text_align(text_align) {
  text_align = text_align.toLowerCase();
  if (text_align == "center") {
    return "center";
  } else if (text_align == "end" || text_align == "right") {
    return "right"; 
  } else { // start or left
    return "left";
  }
}

function parse_text_baseline(text_baseline) {
  text_baseline = text_baseline.toLowerCase();
  if (text_baseline == "top" || text_baseline == "hanging") {
    return "top";
  } else if (text_baseline == "middle") {
    return "middle";
  } else if (text_baseline == "bottom") {
    return "bottom";
  } else { // alphabetic or ideographic
    return "alphabetic";
  }
}

function parse_colour(colour) {
  var hex6_re = /^#([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])$/;
  var hex3_re = /^#([0-9a-f])([0-9a-f])([0-9a-f])$/;
  var rgb_re = /^\s*rgb\s*\(\s*(\d{1,3})(%?)\s*,\s*(\d{1,3})(%?)\s*,\s*(\d{1,3})(%?)\s*\)\s*$/;
  var rgba_re = /^\s*rgba\s*\(\s*(\d{1,3})(%?)\s*,\s*(\d{1,3})(%?)\s*,\s*(\d{1,3})(%?)\s*,\s*(\d{1,3})(%?)\s*\)\s*$/;
  if (colour == null || colour == "") {
    return {'red': 0, 'green': 0, 'blue': 0, 'alpha': 255};
  }
  colour = colour.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); //trim
  colour = colour.toLowerCase();
  if (colour == "maroon") {// #800000
    return {'red': 128, 'green': 0, 'blue': 0, 'alpha': 255};
  } else if (colour == "red") { // #FF0000
    return {'red': 255, 'green': 0, 'blue': 0, 'alpha': 255};
  } else if (colour == "orange") { // FFA500
    return {'red': 255, 'green': 165, 'blue': 0, 'alpha': 255};
  } else if (colour == "yellow") { // #FFFF00
    return {'red': 255, 'green': 255, 'blue': 0, 'alpha': 255};
  } else if (colour == "olive") { // #808000
    return {'red': 128, 'green': 128, 'blue': 0, 'alpha': 255};
  } else if (colour == "purple") { // #800080
    return {'red': 128, 'green': 0, 'blue': 128, 'alpha': 255};
  } else if (colour == "fuchsia" || colour == "magenta") { // #FF00FF
    return {'red': 255, 'green': 0, 'blue': 255, 'alpha': 255};
  } else if (colour == "white") { // #FFFFFF
    return {'red': 255, 'green': 255, 'blue': 255, 'alpha': 255};
  } else if (colour == "lime") { // #00FF00
    return {'red': 0, 'green': 255, 'blue': 0, 'alpha': 255};
  } else if (colour == "green") { // #008000
    return {'red': 0, 'green': 128, 'blue': 0, 'alpha': 255};
  } else if (colour == "navy") { // #000080
    return {'red': 0, 'green': 0, 'blue': 128, 'alpha': 255};
  } else if (colour == "blue") { // #0000FF
    return {'red': 0, 'green': 0, 'blue': 255, 'alpha': 255};
  } else if (colour == "aqua" || colour == "cyan") { // #00FFFF
    return {'red': 0, 'green': 255, 'blue': 255, 'alpha': 255};
  } else if (colour == "teal") { // #008080
    return {'red': 0, 'green': 128, 'blue': 128, 'alpha': 255};
  } else if (colour == "black") { // #000000
    return {'red': 0, 'green': 0, 'blue': 0, 'alpha': 255};
  } else if (colour == "silver") { // #C0C0C0
    return {'red': 192, 'green': 192, 'blue': 192, 'alpha': 255};
  } else if (colour == "gray") { // #808080
    return {'red': 128, 'green': 128, 'blue': 128, 'alpha': 255};
  }
  var matches;
  matches = hex6_re.exec(colour);
  if (matches) {
    var red = parseInt(matches[1], 16);
    var green = parseInt(matches[2], 16);
    var blue = parseInt(matches[3], 16);
    return {'red': red, 'green': green, 'blue': blue, 'alpha': 255};
  }
  matches = hex3_re.exec(colour);
  if (matches) {
    var red = parseInt(matches[1] + matches[1], 16);
    var green = parseInt(matches[2] + matches[2], 16);
    var blue = parseInt(matches[3] + matches[3], 16);
    return {'red': red, 'green': green, 'blue': blue, 'alpha': 255};
  }
  matches = rgb_re.exec(colour);
  if (matches) {
    var red = parseInt(matches[1]);
    if (matches[2] == "%") red = Math.round((red * 255) / 100);
    var green = parseInt(matches[3]);
    if (matches[4] == "%") green = Math.round((green * 255) / 100);
    var blue = parseInt(matches[5]);
    if (matches[6] == "%") blue = Math.round((blue * 255) / 100);
    return {'red': red, 'green': green, 'blue': blue, 'alpha': 255};
  }
  matches = rgba_re.exec(colour);
  if (matches) {
    var red = parseInt(matches[1]);
    if (matches[2] == "%") red = Math.round((red * 255) / 100);
    var green = parseInt(matches[3]);
    if (matches[4] == "%") green = Math.round((green * 255) / 100);
    var blue = parseInt(matches[5]);
    if (matches[6] == "%") blue = Math.round((blue * 255) / 100);
    var alpha = parseInt(matches[7]);
    if (matches[8] == "%") alpha = Math.round((alpha * 255) / 100);
    return {'red': red, 'green': green, 'blue': blue, 'alpha': alpha};
  }
  // default to black
  throw new Error("Failed to parse colour: " + colour);
}

function colour_equals(colour1, colour2) {
  if (colour1.red != colour2.red) return false;
  if (colour1.green != colour2.green) return false;
  if (colour1.blue != colour2.blue) return false;
  if (colour1.alpha != colour2.alpha) return false;
  return true;
}

// splits a font string into words
function split_words(str) {
  var words = [];
  var start = -1;
  var space = /\s/;
  var single_quote = false;
  var double_quote = false;
  // read words
  for (var i = 0; i < str.length; i++) {
    if (start == -1) {
      if (!space.test(str.charAt(i))) {
        switch (str.charAt(i)) {
          case "'":
            single_quote = true;
            start = i + 1;
            break;
          case '"':
            double_quote = true;
            start = i + 1;
            break;
          default:
            start = i;
        }
      }
    } else {
      if (!single_quote && !double_quote) {
        if (space.test(str.charAt(i))) {
          var len = i - start;
          if (len > 0) words.push(str.substr(start, len));
          start = -1;
        } else if (str.charAt(i) == "'" || str.charAt(i) == '"') {
          throw new Error("Quote in the middle of an unquoted word!");
        }
      } else if (single_quote) {
        if (str.charAt(i) == "'") {
          var len = i - start;
          if (len > 0) words.push(str.substr(start, len));
          start = -1;
          single_quote = false;
        }
      } else if (double_quote) {
        if (str.charAt(i) == '"') {
          var len = i - start;
          if (len > 0) words.push(str.substr(start, len));
          start = -1;
          double_quote = false;
        }
      }
    }
  }
  if (start != -1) {
    if (single_quote || double_quote) throw new Error("Unterminated quoted region");
    words.push(str.substr(start));
  }
  return words;
}

function add_intercepts(ctx2d, eps_callback) {
  ctx2d.eps_callback = eps_callback;
  ctx2d.save = function() {
    this.eps_callback.save();
    Object.getPrototypeOf(this).save.call(this);
  };
  ctx2d.restore = function() {
    this.eps_callback.restore();
    Object.getPrototypeOf(this).restore.call(this);
  };
  ctx2d.beginPath = function() {
    this.eps_callback.beginPath();
    Object.getPrototypeOf(this).beginPath.call(this);
  };
  ctx2d.closePath = function() {
    this.eps_callback.closePath();
    Object.getPrototypeOf(this).closePath.call(this);
  };
  ctx2d.moveTo = function(x, y) {
    this.eps_callback.moveTo(x, y);
    Object.getPrototypeOf(this).moveTo.call(this, x, y);
  };
  ctx2d.lineTo = function(x, y) {
    this.eps_callback.lineTo(x, y);
    Object.getPrototypeOf(this).lineTo.call(this, x, y);
  };
  ctx2d.rect = function(x, y, w, h) {
    this.eps_callback.rect(x, y, w, h);
    Object.getPrototypeOf(this).rect.call(this, x, y, w, h);
  };
  ctx2d.arc = function(x, y, radius, startAngle, endAngle, anticlockwise) {
    this.eps_callback.arc(x, y, radius, startAngle, endAngle, anticlockwise);
    Object.getPrototypeOf(this).arc.call(this, x, y, radius, startAngle, endAngle, anticlockwise);
  };
  ctx2d.arcTo = function(cpx1, cpy1, cpx2, cpy2, radius) {
    this.eps_callback.arcTo(cpx1, cpy1, cpx2, cpy2, radius);
    Object.getPrototypeOf(this).arcTo.call(this, cpx1, cpy1, cpx2, cpy2, radius);
  };
  ctx2d.quadraticArcTo = function(cpx, cpy, x, y) {
    this.eps_callback.quadraticArcTo(cpx, cpy, x, y);
    Object.getPrototypeOf(this).quadraticArcTo.call(this, cpx, cpy, x, y);
  };
  ctx2d.bezierCurveTo = function(cp1x, cp1y, cp2x, cp2y, x, y) {
    this.eps_callback.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);
    Object.getPrototypeOf(this).bezierCurveTo.call(this, cp1x, cp1y, cp2x, cp2y, x, y);
  };
  ctx2d.stroke = function() {
    this.eps_callback.stroke();
    Object.getPrototypeOf(this).stroke.call(this);
  };
  ctx2d.fill = function() {
    this.eps_callback.fill();
    Object.getPrototypeOf(this).fill.call(this);
  };
  ctx2d.clip = function() {
    this.eps_callback.clip();
    Object.getPrototypeOf(this).clip.call(this);
  };
  ctx2d.fillRect = function(x, y, width, height) {
    this.eps_callback.fillRect(x, y, width, height);
    Object.getPrototypeOf(this).fillRect.call(this, x, y, width, height);
  };
  ctx2d.strokeRect = function(x, y, width, height) {
    this.eps_callback.strokeRect(x, y, width, height);
    Object.getPrototypeOf(this).strokeRect.call(this, x, y, width, height);
  };
  ctx2d.clearRect = function(x, y, width, height) {
    this.eps_callback.clearRect(x, y, width, height);
    Object.getPrototypeOf(this).clearRect.call(this, x, y, width, height);
  };
  ctx2d.fillText = function(string, x, y) {
    this.eps_callback.fillText(string, x, y);
    Object.getPrototypeOf(this).fillText.call(this, string, x, y);
  };
  ctx2d.translate = function(dx, dy) {
    this.eps_callback.translate(dx, dy);
    Object.getPrototypeOf(this).translate.call(this, dx, dy);
  };
  ctx2d.rotate = function(angle) {
    this.eps_callback.rotate(angle);
    Object.getPrototypeOf(this).rotate.call(this, angle);
  };
  ctx2d.scale = function(sx, sy) {
    this.eps_callback.scale(sx, sy);
    Object.getPrototypeOf(this).scale.call(this, sx, sy);
  };
  ctx2d.transform = function(m11, m12, m21, m22, dx, dy) {
    this.eps_callback.transform(m11, m12, m21, m22, dx, dy);
    Object.getPrototypeOf(this).transform.call(this, m11, m12, m21, m22, dx, dy);
  };
  ctx2d.setTransform = function(m11, m12, m21, m22, dx, dy) {
    this.eps_callback.setTransform(m11, m12, m21, m22, dx, dy);
    Object.getPrototypeOf(this).setTransform.call(this, m11, m12, m21, m22, dx, dy);
  };
}

var EpsState = function(copy) {
  // canvas vars
  this.activeStyle = {'red': 0, 'green': 0, 'blue': 0, 'alpha': 255};
  this.fillStyle = {'red': 0, 'green': 0, 'blue': 0, 'alpha': 255};
  this.strokeStyle = {'red': 0, 'green': 0, 'blue': 0, 'alpha': 255};
  this.lineWidth = 1.0;
  this.lineCap = 0;
  this.lineJoin = 0;
  this.miterLimit = 10.0;
  this.font = null;
  this.textAlign = "left";
  this.textBaseline = "alphabetic";
  if (copy) {
    this.activeStyle = copy.activeStyle;
    this.fillStyle = copy.fillStyle;
    this.strokeStyle = copy.strokeStyle;
    this.lineWidth = copy.lineWidth;
    this.lineCap = copy.lineCap;
    this.lineJoin = copy.lineJoin;
    this.miterLimit = copy.miterLimit;
    this.font = copy.font;
    this.textAlign = copy.textAlign;
    this.textBaseline = copy.textBaseline;
  }
};


var EpsContext = function(ctx, width, height) {
  var title = "Image Title";
  var creator = "Image Creator";
  var date = new Date();
  // private parameters
  this.ctx = ctx;
  this.width = width;
  this.height = height;
  this.stack = [];
  this.current_state = new EpsState();
  this.font_lookup = {};
  this.indent = "";
  this.eps_text = 
    "%!PS-Adobe-3.0 EPSF-3.0\n" + 
    "%%Title: " + title + "\n" + 
    "%%Creator: " + creator + "\n" +
    "%%CreationDate: " + date.toUTCString() + "\n" + 
    "%%BoundingBox: 0 0 " + (width * 0.75) + " " + (height * 0.75) + "\n" +
    "%%Pages: 0\n" +
    "%%DocumentFonts:\n" +
    "%%EndComments\n" +
    "0.75 0.75 scale\n" +
    "0 " + height + " translate\n" + 
    "1 -1 scale\n";
  add_intercepts(ctx, this);
};

// look for differences between the current state and the settings to see 
// what has changed. Apply the changes to the eps file.
EpsContext.prototype.detect = function() {
  var state = this.current_state;
  var ctx = this.ctx;
  if (ctx.lineWidth != state.lineWidth) {
    state.lineWidth = ctx.lineWidth;
    this.eps_text += this.indent + state.lineWidth + " setlinewidth\n";
  }
  var cap = parse_line_cap(ctx.lineCap);
  if (cap != state.lineCap) {
    state.lineCap = cap;
    this.eps_text += this.indent + state.lineCap + " setlinecap\n";
  }
  var join = parse_line_join(ctx.lineJoin);
  if (join != state.lineJoin) {
    state.lineJoin = join;
    this.eps_text += this.indent + state.lineJoin + " setlinejoin\n";
  }
  var miterLimit = parseInt(ctx.miterLimit);
  if (miterLimit != state.miterLimit) {
    state.miterLimit = miterLimit;
    this.eps_text += this.indent + state.miterLimit + " setmiterlimit\n";
  }
  var strokeStyle = parse_colour(ctx.strokeStyle);
  if (!colour_equals(strokeStyle, state.strokeStyle)) {
    state.strokeStyle = strokeStyle;
    this.activateStyle(false);
  }
  var fillStyle = parse_colour(ctx.fillStyle);
  if (!colour_equals(fillStyle, state.fillStyle)) {
    state.fillStyle = fillStyle;
    this.activateStyle(true);
  }
  var textAlign = parse_text_align(ctx.textAlign);
  if (textAlign != state.textAlign) {
    state.textAlign = textAlign;
  }
  var textBaseline = parse_text_baseline(ctx.textBaseline);
  if (textBaseline != state.textBaseline) {
    state.textBaseline = textBaseline;
  }
  var font = this.lookup_font(ctx.font);
  if (font != null && font !== state.font) {
    state.font = font;
    this.eps_text += this.indent + "/" + font.name + " findfont " +  
      font.size + " scalefont setfont\n";
  }
};

EpsContext.prototype.activateStyle = function(useFillStyle) {
  var state = this.current_state;
  var style = (useFillStyle ? state.fillStyle : state.strokeStyle);
  if (!colour_equals(state.activeStyle, style)) {
    this.eps_text += this.indent + (style.red / 255) + " " + 
      (style.green / 255) + " " + (style.blue / 255) + " setrgbcolor\n";
    state.activeStyle = style;
  }
};


// saves the current state on the stack
EpsContext.prototype.save = function() {
  this.detect();
  // gsave
  this.eps_text += this.indent + "gsave\n";
  this.stack.push(new EpsState(this.current_state));
  this.indent += "  ";
};

// restores the last saved state
EpsContext.prototype.restore = function() {
  if (this.stack.length == 0) throw new Error("Call to restore not matched with call to save.");
  this.detect();
  this.current_state = this.stack.pop();
  this.indent = Array(this.stack.length + 1).join("  ");
  // grestore
  this.eps_text += this.indent + "grestore\n";
};

// start a path
EpsContext.prototype.beginPath = function() {
  this.detect();
  // newpath
  this.eps_text += this.indent + "newpath\n";
};

// join the current position to the path start
EpsContext.prototype.closePath = function() {
  this.detect();
  // closepath
  this.eps_text += this.indent + "closepath\n";
};

// move the current position
EpsContext.prototype.moveTo = function(x, y) {
  this.detect();
  // moveto
  this.eps_text += this.indent + x + " " + y + " moveto\n";
};

// join the current position to a new position and update the current position
EpsContext.prototype.lineTo = function(x, y) {
  this.detect();
  // lineto
  this.eps_text += this.indent + x + " " + y + " lineto\n";
};

// add a rectangle to the path
EpsContext.prototype.rect = function(x, y, width, height) {
  this.moveTo(x, y);
  this.lineTo(x + width, y);
  this.lineTo(x + width, y + height);
  this.lineTo(x, y + height);
  this.closePath();
};

// add an arc to the path
EpsContext.prototype.arc = function(x, y, radius, startAngle, endAngle, anticlockwise) {
  this.detect();
  if (anticlockwise) {
    // command "X Y RADIUS START_ANGLE END_ANGLE arc"
    this.eps_text += this.indent + x + " " + y + " " + radius + " " + rad2deg(startAngle) + " " + rad2deg(endAngle) + " arcn\n";
  } else {
    // command "X Y RADIUS START_ANGLE END_ANGLE arcn"
    this.eps_text += this.indent + x + " " + y + " " + radius + " " + rad2deg(startAngle) + " " + rad2deg(endAngle) + " arc\n";
  }
};

// imagine two lines, one going from the current position to point 1 and
// another going from point 1 to point 2. 
// Now imagine a circle of the given radius which touches the two lines at at 
// two tangental points T01 and T12. Add a line to the path that goes from
// the current position to T01 and add the arc which goes from T01 to T12.
// see http://www.dbp-consulting.com/tutorials/canvas/CanvasArcTo.html
EpsContext.prototype.arcTo = function(cpx1, cpy1, cpx2, cpy2, radius) {
  this.detect();
  // command "X1 Y1 X2 Y2 RADIUS arct"
  this.eps_text += this.indent + cpx1 + " " + cpy1 + " " + cpx2 + " " + cpy2 + " " + radius + " arct\n";
};

EpsContext.prototype.quadraticArcTo = function(cpx, cpy, x, y) {
  /* 
   For the equations below the following variable name prefixes are used: 
     qp0 is the quadratic curve starting point (you must keep this from your 
        last point sent to moveTo(), lineTo(), or bezierCurveTo() ). 
     qp1 is the quadratic curve control point (this is the cpx,cpy you would 
        have sent to quadraticCurveTo() ). 
     qp2 is the quadratic curve ending point (this is the x,y arguments you 
        would have sent to quadraticCurveTo() ). 
   We will convert these points to compute the two needed cubic control points 
    (the starting/ending points are the same for both 
   the quadratic and cubic curves. 
 
   The exact equations for the two cubic control points are: 
     cp0 = qp0 and cp3 = qp2 
     cp1 = qp0 + (qp1 - qp0) * ratio 
     cp2 = cp1 + (qp2 - qp0) * (1 - ratio) 
     where ratio = (sqrt(2) - 1) * 4 / 3 exactly (approx. 0.5522847498307933984022516322796) 
                   if the quadratic is an approximation of an elliptic arc, 
                      and the cubic must approximate the same arc, or 
           ratio = 2.0 / 3.0 for keeping the same quadratic curve. 
 
   In the code below, we must compute both the x and y terms for each point separately. 
 
    cp1x = qp0x + (qp1x - qp0x) * ratio; 
    cp1y = qp0y + (qp1y - qp0y) * ratio; 
    cp2x = cp1x + (qp2x - qp0x) * (1 - ratio); 
    cp2y = cp1y + (qp2y - qp0y) * (1 - ratio); 
 
   We will now  
     a) replace the qp0x and qp0y variables with currentX and currentY 
        (which *you* must store for each moveTo/lineTo/bezierCurveTo) 
     b) replace the qp1x and qp1y variables with cpx and cpy (which we would 
        have passed to quadraticCurveTo) 
     c) replace the qp2x and qp2y variables with x and y. 
   which leaves us with:  
  */  
  var ratio = 2.0 / 3.0; // 0.5522847498307933984022516322796 if the Bezier is 
                        // approximating an elliptic arc with best fitting  
  var cp1x = this.currentX + (cpx - this.currentX) * ratio;  
  var cp1y = this.currentY + (cpy - this.currentY) * ratio;  
  var cp2x = cp1x + (x - this.currentX) * (1 - ratio);  
  var cp2y = cp1y + (y - this.currentY) * (1 - ratio);  
  
  // and now call cubic Bezier curve to function   
  this.bezierCurveTo( cp1x, cp1y, cp2x, cp2y, x, y );
};

// add a bezier curve to the path
EpsContext.prototype.bezierCurveTo = function(cp1x, cp1y, cp2x, cp2y, x, y) {
  this.detect();
  // command "CP1X CP1Y CP2X CP2Y X Y curveto"
  this.eps_text += this.indent + cp1x + " " + cp1y + " " + cp2x + " " + cp2y + " " + x + " " + y + " curveto";
};

// stroke the current path
EpsContext.prototype.stroke = function() {
  this.detect();
  this.activateStyle(false);
  // stroke
  this.eps_text += this.indent + "stroke\n";
};

// fill the current path
EpsContext.prototype.fill = function() {
  this.detect();
  this.activateStyle(true);
  // fill
  this.eps_text += this.indent + "fill\n";
};

// create a clipping region from the current path
EpsContext.prototype.clip = function() {
  this.detect();
  // clip
  this.eps_text += this.indent + "clip\n";
};

// Draws a filled rectangle
EpsContext.prototype.fillRect = function(x, y, width, height) {
  this.detect();
  this.activateStyle(true);
  // rectfill
  this.eps_text += this.indent + x + " " + y + " " + width + " " + height + " rectfill\n";
};

// Draws a rectangular outline
EpsContext.prototype.strokeRect = function(x, y, width, height) {
  this.detect();
  this.activateStyle(false);
  // rectstroke
  this.eps_text += this.indent + x + " " + y + " " + width + " " + height + " rectstroke\n";
};

// Clears the specified area and makes it transparent.
EpsContext.prototype.clearRect = function(x, y, width, height) {
  this.detect();
  // fill a rectangle with white in the cleared region
  // EPS doesn't do transparency so this is as close as it can get
  // command "1 setgray X Y WIDTH HEIGHT rectfill"
  this.eps_text += this.indent + "gsave\n";
  this.eps_text += this.indent + "  1 setgray\n";
  this.eps_text += this.indent + "  " + x + " " + y + " " + width + " " + height + " rectfill\n";
  this.eps_text += this.indent + "grestore\n";
};

// Draws a filled string
EpsContext.prototype.fillText = function(string, x, y) {
  var state = this.current_state;
  this.detect();
  this.activateStyle(true);
  // lookup the font with "/FONT_NAME findfont" (leaves FONT on stack)
  // scale the font with "FONT SIZE scalefont" (leaves FONT on stack
  // set the font with "FONT setfont"
  // move the printing location with "X Y moveto"
  // various measurement commands will be needed to do center alignment etc
  // like "stringwidth"
  // show the text with "(STRING) show"
  string = string.replace(/\\/g, "\\\\");
  string = string.replace(/\(/g, "\\(");
  string = string.replace(/\)/g, "\\)");
  this.save();
  this.translate(x, y);
  this.scale(1, -1);
  this.eps_text += this.indent + "(" + string + ")\n";
  if (state.textBaseline != "alphabetic") {
    this.beginPath();
    this.moveTo(0,0);
    this.eps_text += this.indent + "dup true charpath flattenpath pathbbox %bounding box\n";
    this.eps_text += this.indent + "/ascent exch def pop /decent exch def pop\n";
    if (state.textBaseline == "top") {
      this.eps_text += this.indent + "0 ascent neg translate %vertical align top\n";
    } else if (state.textBaseline == "middle") {
      this.eps_text += this.indent + "0 ascent decent sub 2 div decent sub neg translate %vertical align middle\n";
    } else if (state.textBaseline == "bottom") {
      this.eps_text += this.indent + "0 decent neg translate %vertical align bottom\n";
    }
  }
  if (state.textAlign == "right") {
    this.eps_text += this.indent + "dup stringwidth pop neg 0 translate %right align\n"  
  } else if (state.textAlign == "center") {
    this.eps_text += this.indent + "dup stringwidth pop 2 div neg 0 translate %center align\n"  
  }
  this.moveTo(0,0);
  this.eps_text += this.indent + "show\n";
  this.restore();
};

// move the canvas origin
EpsContext.prototype.translate = function(dx, dy) {
  this.detect();
  // command "DELTA_X DELTA_Y translate"
  this.eps_text += this.indent + dx + " " + dy + " translate\n";
};

// rotate around the canvas origin
EpsContext.prototype.rotate = function(angle) {
  this.detect();
  // command "DEGREES rotate" (note need to convert angle from radians to degrees)
  this.eps_text += this.indent + rad2deg(angle) + " rotate\n";
};

// scale 
EpsContext.prototype.scale = function(scale_x, scale_y) {
  this.detect();
  // command "SCALE_X SCALE_Y scale
  this.eps_text += this.indent + scale_x + " " + scale_y + " scale\n";
};

// multiplies the current transform matrix by the matrix described by:
// m11    m21   dx
// m12    m22   dy
// 0      0     1
EpsContext.prototype.transform = function(m11, m12, m21, m22, dx, dy) {
  this.detect();
  // command "[M11 M12 M21 M22 DX DY] concat"
  this.eps_text += this.indent + "[" + m11 + " " + m12 + " " + m21 + " " + m22 + " " + dx + " " + dy + "] concat\n";
};

// reset transform matrix to the identity matrix then call transform
EpsContext.prototype.setTransform = function(m11, m12, m21, m22, dx, dy) {
  // command:
  // "[1 0 0 1 0 0] defaultmatrix setmatrix 0 height translate 1 -1 scale "
  // "[M11 M12 M21 M22 DX DY] concat"
  this.eps_text += this.indent + "[1 0 0 1 0 0] defaultmatrix setmatrix\n";
  this.eps_text += this.indent + "0 " + this.height + " translate\n";
  this.eps_text += this.indent + "1 -1 scale\n";
  this.transform(m11, m12, m21, m22, dx, dy);
};

EpsContext.prototype.register_font = function(font_str, eps_font, size) {
  font_str = font_str.replace(/\s+/g, ""); // remove spaces
  font_str = font_str.toLowerCase(); // lower case
  this.font_lookup[font_str] = {'name': eps_font, 'size': size};
};

EpsContext.prototype.lookup_font = function(font_str) {
  font_str = font_str.replace(/\s+/g, ""); // remove spaces
  font_str = font_str.toLowerCase(); // lower case
  return this.font_lookup[font_str];
};

// return the EPS text
EpsContext.prototype.eps = function() {
  return this.eps_text + this.indent + "showpage\n";
};

    </script>
    <script type="text/javascript">
//======================================================================
// start Alphabet object
//======================================================================
var Alphabet = function(alphabet, background) {
  "use strict";
  var i, j, sym, aliases, complement, comp_e_sym, ambigs, generate_background;
  generate_background = (background == null);
  if (generate_background) {
    background = [];
    for (i = 0; i < alphabet.ncore; i++) background[i] = 1.0 / alphabet.ncore;
  } else if (alphabet.ncore != background.length) {
    throw new Error("The background length does not match the alphabet length.");
  }
  this.name = alphabet.name;
  this.like = (alphabet.like != null ? alphabet.like.toUpperCase() : null);
  this.ncore = alphabet.ncore;
  this.symbols = alphabet.symbols;
  this.background = background;
  this.genbg = generate_background;
  this.encode = {};
  this.encode2core = {};
  this.complement = {};
  // check if all symbols are same case
  var seen_uc = false;
  var seen_lc = false;
  var check_case = function (syms) {
    var s, sym;
    if (typeof syms === "string") {
      for (s = 0; s < syms.length; s++) {
        sym = syms.charAt(s);
        if (sym >= 'a' && sym <= 'z') seen_lc = true;
        else if (sym >= 'A' && sym <= 'Z') seen_uc = true;
      }
    }
  };
  for (i = 0; i < this.symbols.length; i++) {
    check_case(this.symbols[i].symbol);
    check_case(this.symbols[i].aliases);
  }
  // now map symbols to indexes
  var update_array = function(array, syms, index) {
    var s, sym;
    if (typeof syms === "string") {
      for (s = 0; s < syms.length; s++) {
        sym = syms.charAt(s);
        array[sym] = index;
        // when only a single case is used, then encode as case insensitive
        if (seen_uc != seen_lc) {
          if (sym >= 'a' && sym <= 'z') {
            array[sym.toUpperCase()] = index;
          } else if (sym >= 'A' && sym <= 'Z') {
            array[sym.toLowerCase()] = index;
          }
        }
      }
    }
  }
  // map core symbols to index
  for (i = 0; i < this.ncore; i++) {
    update_array(this.encode2core, this.symbols[i].symbol, i);
    update_array(this.encode, this.symbols[i].symbol, i);
    update_array(this.encode2core, this.symbols[i].aliases, i);
    update_array(this.encode, this.symbols[i].aliases, i);
  }
  // map ambiguous symbols to index
  ambigs = {};
  for (i = this.ncore; i < this.symbols.length; i++) {
    update_array(this.encode, this.symbols[i].symbol, i);
    update_array(this.encode, this.symbols[i].aliases, i);
    ambigs[this.symbols[i].equals] = i;
  }
  // determine complements
  for (i = 0; i < this.ncore; i++) {
    complement = this.symbols[i].complement;
    if (typeof complement === "string") {
      this.complement[i] = this.encode2core[complement];
    }
  }
  next_symbol:
  for (i = this.ncore; i < this.symbols.length; i++) {
    complement = "";
    for (j = 0; j < this.symbols[i].equals.length; j++) {
      comp_e_sym = this.complement[this.encode2core[this.symbols[i].equals.charAt(j)]];
      if (typeof comp_e_sym !== "number") continue next_symbol;
      complement += this.symbols[comp_e_sym].symbol;
    }
    complement = complement.split("").sort().join("");
    if (typeof ambigs[complement] === "number") {
      this.complement[i] = ambigs[complement];
    }
  }
  // determine case insensitivity
  this.case_insensitive = true;
  if (seen_uc == seen_lc) {
    // when there is a mixture of cases it probably won't
    // be case insensitive but we still need to check
    loop:
    for (i = 0; i < this.symbols.length; i++) {
      sym = this.symbols[i].symbol;
      if (sym >= 'A' && sym <= 'Z') {
        if (this.encode[sym.toLowerCase()] != i) {
          this.case_insensitive = false;
          break loop;
        }
      } else if (sym >= 'a' && sym <= 'z') {
        if (this.encode[sym.toUpperCase()] != i) {
          this.case_insensitive = false;
          break loop;
        }
      }
      aliases = this.symbols[i].aliases;
      if (aliases != null) {
        for (j = 0; j < aliases.length; j++) {
          sym = aliases.charAt(j);
          if (sym >= 'A' && sym <= 'Z') {
            if (this.encode[sym.toLowerCase()] != i) {
              this.case_insensitive = false;
              break loop;
            }
          } else if (sym >= 'a' && sym <= 'z') {
            if (this.encode[sym.toUpperCase()] != i) {
              this.case_insensitive = false;
              break loop;
            }
          }
        }
      }
    }
  }
  // normalise aliases to remove the prime symbol and eliminate
  // the alternate cases when the alphabet is case insensitive
  var seen, out;
  for (i = 0; i < this.symbols.length; i++) {
    sym = this.symbols[i].symbol;
    aliases = this.symbols[i].aliases;
    if (typeof aliases != "string") aliases = "";
    seen = {};
    out = [];
    if (this.case_insensitive) {
      sym = sym.toUpperCase();
      aliases = aliases.toUpperCase();
    }
    seen[sym] = true;
    for (j = 0; j < aliases.length; j++) {
      if (!seen[aliases.charAt(j)]) {
        seen[aliases.charAt(j)] = true;
        out.push(aliases.charAt(j));
      }
    }
    this.symbols[i].aliases = out.sort().join("");
  }
};
// return the name of the alphabet
Alphabet.prototype.get_alphabet_name = function() {
  return this.name;
};
// return if the alphabet can be complemented
Alphabet.prototype.has_complement = function() {
  return (typeof this.symbols[0].complement === "string");
};
// return true if an uppercase letter has the same meaning as the lowercase form
Alphabet.prototype.is_case_insensitive = function() {
  return this.case_insensitive;
};
// return the information content of an alphabet letter
Alphabet.prototype.get_ic = function() {
  return Math.log(this.ncore) / Math.LN2;
};
// return the count of the core alphabet symbols
Alphabet.prototype.get_size_core = function() {
  return this.ncore;
};
// return the count of all alphabet symbols
Alphabet.prototype.get_size_full = function() {
  return this.symbols.length;
};
// return the symbol for the given alphabet index
Alphabet.prototype.get_symbol = function(alph_index) {
  "use strict";
  if (alph_index < 0 || alph_index >= this.symbols.length) {
    throw new Error("Alphabet index out of bounds");
  }
  return this.symbols[alph_index].symbol;
};
// return the aliases for the given alphabet index
Alphabet.prototype.get_aliases = function(alph_index) {
  "use strict";
  if (alph_index < 0 || alph_index >= this.symbols.length) {
    throw new Error("Alphabet index out of bounds");
  }
  var sym_obj = this.symbols[alph_index];
  return (sym_obj.aliases != null ? sym_obj.aliases : "");
};
// return the name for the given alphabet index
Alphabet.prototype.get_name = function(alph_index) {
  "use strict";
  var sym;
  if (alph_index < 0 || alph_index >= this.symbols.length) {
    throw new Error("Alphabet index out of bounds");
  }
  sym = this.symbols[alph_index];
  return (typeof sym.name === "string" ? sym.name : sym.symbol);
};
// return the alphabet it is like or null
Alphabet.prototype.get_like = function() {
  "use strict";
  return this.like;
};
// return the index of the complement for the given alphabet index
Alphabet.prototype.get_complement = function(alph_index) {
  var comp_e_sym = this.complement[alph_index];
  if (typeof comp_e_sym === "number") {
    return comp_e_sym;
  } else {
    return -1;
  }
};
// return a string containing the core symbols
Alphabet.prototype.get_symbols = function() {
  "use strict";
  var i, core_symbols;
  core_symbols = "";
  for (i = 0; i < this.ncore; i++) {
    core_symbols += this.symbols[i].symbol;
  }
  return core_symbols;
};
// return if the background was not a uniform generated background
Alphabet.prototype.has_bg = function() {
  "use strict";
  return !this.genbg;
};
// get the background frequency for the index
Alphabet.prototype.get_bg_freq = function(alph_index) {
  "use strict";
  var freq, i, symbols;
  if (alph_index >= 0) {
    if (alph_index < this.ncore) {
      return this.background[alph_index];
    } else if (alph_index < this.symbols.length) {
      freq = 0;
      symbols = this.symbols[alph_index].equals;
      for (i = 0; i < symbols.length; i++) {
        freq += this.background[this.encode2core[symbols.charAt(i)]];
      }
      return freq;
    } 
  }
  throw new Error("The alphabet index is out of range.");
};
// get the colour of the index
Alphabet.prototype.get_colour = function(alph_index) {
  "use strict";
  if (alph_index < 0 || alph_index >= this.symbols.length) {
    throw new Error("BAD_ALPHABET_INDEX");
  }
  if (typeof this.symbols[alph_index].colour != "string") {
    return "black";
  }
  return "#" + this.symbols[alph_index].colour;
};
// get the rgb components of the colour at the index
Alphabet.prototype.get_rgb = function(alph_index) {
  "use strict";
  if (alph_index < 0 || alph_index >= this.symbols.length) {
    throw new Error("BAD_ALPHABET_INDEX");
  }
  if (typeof this.symbols[alph_index].colour != "string") {
    return {"red": 0, "green": 0, "blue": 0};
  }
  var colour = this.symbols[alph_index].colour;
  var red = parseInt(colour.substr(0, 2), 16) / 255;
  var green = parseInt(colour.substr(2, 2), 16) / 255;
  var blue = parseInt(colour.substr(4, 2), 16) / 255;
  return {"red": red, "green": green, "blue": blue};
};
// convert a symbol into the index
Alphabet.prototype.get_index = function(letter) {
  "use strict";
  var alph_index;
  alph_index = this.encode[letter];
  if (typeof alph_index === "undefined") {
    return -1;
  }
  return alph_index;
};
// convert a symbol into the list of core indexes that it equals
Alphabet.prototype.get_indexes = function(letter) {
  "use strict";
  var alph_index, comprise_str, i, comprise_list;
  alph_index = this.encode[letter];
  if (typeof alph_index === "undefined") {
    throw new Error("Unknown letter");
  }
  comprise_str = this.symbols[alph_index].equals;
  comprise_list = [];
  if (typeof comprise_str == "string") {
    for (i = 0; i < comprise_str.length; i++) {
      comprise_list.push(this.encode2core[comprise_str.charAt(i)]);
    }
  } else {
    comprise_list.push(alph_index);
  }
  return comprise_list;
};
// check if a symbol is the primary way of representing the symbol in the alphabet
Alphabet.prototype.is_prime_symbol = function(letter) {
  var alph_index;
  alph_index = this.encode[letter];
  if (alph_index == null) return false;
  if (this.is_case_insensitive()) {
    return (this.symbols[alph_index].symbol.toUpperCase() == letter.toUpperCase());
  } else {
    return (this.symbols[alph_index].symbol == letter);
  }
};
// compare 2 alphabets
Alphabet.prototype.equals = function(other) {
  "use strict";
  var i, sym1, sym2;
  // first check that it's actually an alphabet object
  if (!(typeof other === "object" && other != null && other instanceof Alphabet)) {
    return false;
  }
  // second shortcircuit if it's the same object
  if (this === other) return true;
  // compare
  if (this.name !== other.name) return false;
  if (this.ncore !== other.ncore) return false;
  if (this.symbols.length !== other.symbols.length) return false;
  for (i = 0; i < this.symbols.length; i++) {
    sym1 = this.symbols[i];
    sym2 = other.symbols[i];
    if (sym1.symbol !== sym2.symbol) return false;
    if (sym1.aliases !== sym2.aliases) return false;
    if (sym1.name !== sym2.name) return false;
    if (typeof sym1.colour !== typeof sym2.colour || 
        (typeof sym1.colour === "string" && typeof sym2.colour === "string" &&
         parseInt(sym1.colour, 16) != parseInt(sym2.colour, 16))) {
      return false;
    }
    if (sym1.complement !== sym2.complement) return false;
    if (sym1.equals !== sym2.equals) return false;
  }
  return true;
};
Alphabet.prototype.check_core_subset = function(super_alph) {
  var complement_same = true;
  var seen_set = {};
  var sub_i, sub_symbol, super_i, super_symbol;
  for (sub_i = 0; sub_i < this.ncore; sub_i++) {
    sub_symbol = this.symbols[sub_i];
    super_i = super_alph.encode[sub_symbol.symbol]; 
    if (super_i == null) return 0;
    super_symbol = super_alph.symbols[super_i];
    if (seen_set[super_i]) return 0;
    seen_set[super_i] = true;
    // check complement
    if (sub_symbol.complement != null && super_symbol.complement != null) {
      if (super_alph.encode[sub_symbol.complement] != super_alph.encode[super_symbol.complement]) {
        complement_same = false;
      }
    } else if (sub_symbol.complement != null || super_symbol.complement != null) {
      complement_same = false;
    }
  }
  return (complement_same ? 1 : -1);
};
// convert a sequence to its reverse complement
Alphabet.prototype.invcomp_seq = function(seq) {
  "use strict";
  var syms, i, e_sym, comp_e_sym;
  if (!this.has_complement()) throw new Error("Alphabet must be complementable");
  syms = seq.split("");
  for (i = 0; i < syms.length; i++) {
    e_sym = this.encode[syms[i]];
    if (typeof e_sym === "undefined") {
      e_sym = this.ncore; // wildcard
    }
    comp_e_sym = this.complement[e_sym];
    if (typeof comp_e_sym === "undefined") {
      comp_e_sym = e_sym; // not complementable
    }
    syms[i] = this.symbols[comp_e_sym].symbol;
  }
  return syms.reverse().join("");
};
// convert the alphabet to the text version
Alphabet.prototype.as_text = function() {
  "use strict";
  function name_as_text(name) {
    var i, c, out;
    out = "\"";
    for (i = 0; i < name.length; i++) {
      c = name.charAt(i);
      if (c == "\"") {
        out += "\\\"";
      } else if (c == "/") {
        out += "\\/";
      } else if (c == "\\") {
        out += "\\\\";
      } else {
        out += c;
      }
    }
    out += "\"";
    return out;
  }
  function symbol_as_text(sym) {
    var out;
    out = sym.symbol;
    if (typeof sym.name === "string" && sym.name != sym.symbol) {
      out += " " + name_as_text(sym.name);
    }
    if (typeof sym.colour === "string") {
      out += " " + sym.colour;
    }
    return out;
  }
  var out, i, j, c, sym;
  out = "";
  // output core symbols with 2 way complements
  for (i = 0; i < this.ncore; i++) {
    c = this.complement[i];
    if (typeof c === "number" && i < c && this.complement[c] === i) {
      out += symbol_as_text(this.symbols[i]) + " ~ " + symbol_as_text(this.symbols[c]) + "\n";  
    }
  }
  // output core symbols with no complement
  for (i = 0; i < this.ncore; i++) {
    if (typeof this.complement[i] === "undefined") {
      out += symbol_as_text(this.symbols[i]) + "\n";
    }
  }
  // output ambiguous symbols that have comprising characters
  for (i = this.ncore; i < this.symbols.length; i++) {
    if (this.symbols[i].equals.length == 0) break;
    out += symbol_as_text(this.symbols[i]) + " = " + this.symbols[i].equals + "\n";
    if (typeof this.symbols[i].aliases === "string") {
      for (j = 0; j < this.symbols[i].aliases.length; j++) {
        if (this.symbols[i].aliases.charAt(j) == this.symbols[i].symbol) continue;
        out += this.symbols[i].aliases.charAt(j) + " = " + this.symbols[i].equals + "\n";
      }
    }
  }
  // output aliases of core symbols
  for (i = 0; i < this.ncore; i++) {
    if (typeof this.symbols[i].aliases === "string") {
      for (j = 0; j < this.symbols[i].aliases.length; j++) {
        if (this.symbols[i].aliases.charAt(j) == this.symbols[i].symbol) continue;
        out += this.symbols[i].aliases.charAt(j) + " = " + this.symbols[i].symbol + "\n";
      }
    }
  }
  // output gap symbols
  i = this.symbols.length - 1;
  if (this.symbols[i].equals.length == 0) {
    out += symbol_as_text(this.symbols[i]) + " =\n";
    if (typeof this.symbols[i].aliases === "string") {
      for (j = 0; j < this.symbols[i].aliases.length; j++) {
        if (this.symbols[i].aliases.charAt(j) == this.symbols[i].symbol) continue;
        out += this.symbols[i].aliases.charAt(j) + " =\n";
      }
    }
  }
  return out;
};
// output the alphabet as it appears in minimal MEME format
Alphabet.prototype.as_meme = function() {
  "use strict";
  function name_as_text(name) {
    var i, c, out;
    out = "\"";
    for (i = 0; i < name.length; i++) {
      c = name.charAt(i);
      if (c == "\"") {
        out += "\\\"";
      } else if (c == "/") {
        out += "\\/";
      } else if (c == "\\") {
        out += "\\\\";
      } else {
        out += c;
      }
    }
    out += "\"";
    return out;
  }
  if (this.equals(AlphStd.DNA)) {
    return "ALPHABET= ACGT\n";
  } else if (this.equals(AlphStd.PROTEIN)) {
    return "ALPHABET= ACDEFGHIKLMNPQRSTVWY\n";
  } else {
    return "ALPHABET" + 
      (this.name != null ? " " + name_as_text(this.name) : "") + 
      (this.like != null ? " " + this.like + "-LIKE" : "") + "\n" +
      this.as_text() + "END ALPHABET\n";
  }
};

// Returns a table showing all the letters in the alphabet
Alphabet.prototype.as_table = function() {
  "use strict";
  var i, j, row, th, td, aliases, equals, sym;
  var table = document.createElement("table");
  // create the core symbol header
  row = table.insertRow(table.rows.length);
  th = document.createElement("th");
  th.appendChild(document.createTextNode("Symbol(s)"));
  row.appendChild(th);
  th = document.createElement("th");
  th.appendChild(document.createTextNode("Name"));
  row.appendChild(th);
  th = document.createElement("th");
  if (this.has_complement()) {
    th.appendChild(document.createTextNode("Complement"));
  }
  row.appendChild(th);
  // list the core symbols
  for (i = 0; i < this.ncore; i++) {
    row = table.insertRow(table.rows.length);
    td = document.createElement("td");
    if (this.symbols[i].colour != null) {
      td.style.color = '#' + this.symbols[i].colour;
    }
    td.appendChild(document.createTextNode(this.symbols[i].symbol));
    aliases = this.get_aliases(i);
    if (aliases.length > 0) {
      td.appendChild(document.createTextNode(' ' + aliases.split('').join(' ')));
    }
    row.appendChild(td);
    td = document.createElement("td");
    if (this.symbols[i].name != null) {
      td.appendChild(document.createTextNode(this.symbols[i].name));
    }
    row.appendChild(td);
    td = document.createElement("td");
    if (this.symbols[i].complement != null) {
      td.style.color = this.get_colour(this.get_index(this.symbols[i].complement));
      td.appendChild(document.createTextNode(this.symbols[i].complement));
    }
    row.appendChild(td);
  }
  // create the ambiguous symbol header
  row = table.insertRow(table.rows.length);
  th = document.createElement("th");
  th.appendChild(document.createTextNode("Symbol(s)"));
  row.appendChild(th);
  th = document.createElement("th");
  th.appendChild(document.createTextNode("Name"));
  row.appendChild(th);
  th = document.createElement("th");
  th.appendChild(document.createTextNode("Matches"));
  row.appendChild(th);
  // list the ambiguous symbols
  for (i = this.ncore; i < this.symbols.length; i++) {
    row = table.insertRow(table.rows.length);
    td = document.createElement("td");
    if (this.symbols[i].colour != null) {
      td.style.color = '#' + this.symbols[i].colour;
    }
    td.appendChild(document.createTextNode(this.symbols[i].symbol));
    aliases = this.get_aliases(i);
    if (aliases.length > 0) {
      td.appendChild(document.createTextNode(' ' + aliases.split('').join(' ')));
    }
    row.appendChild(td);
    td = document.createElement("td");
    if (this.symbols[i].name != null) {
      td.appendChild(document.createTextNode(this.symbols[i].name));
    }
    row.appendChild(td);
    td = document.createElement("td");
    equals = this.symbols[i].equals.split('');
    for (j = 0; j < equals.length; j++) {
      if (j != 0) td.appendChild(document.createTextNode(' '));
      sym = document.createElement("span");
      sym.style.color = this.get_colour(this.get_index(equals[j]));
      sym.appendChild(document.createTextNode(equals[j]));
      td.appendChild(sym);
    }
    row.appendChild(td);
  }
  return table;
};

// returns a dictionary of the colours for EPS
Alphabet.prototype._as_eps_dict = function() {
  "use strict";
  var i, sym, rgb;
  var out = "/fullColourDict <<\n";
  for (i = 0; i < this.ncore; i++) {
    sym = this.get_symbol(i);
    sym = sym.replace(/\\/g, "\\\\");
    sym = sym.replace(/\(/g, "\\(");
    sym = sym.replace(/\)/g, "\\)");
    rgb = this.get_rgb(i);
    out += " (" + sym + ") [" + rgb.red.toFixed(4) + " " + rgb.green.toFixed(4) + " " + rgb.blue.toFixed(4) + "]\n";
  }
  out += ">> def\n";
  out += "/mutedColourDict <<\n";
  for (i = 0; i < this.ncore; i++) {
    sym = this.get_symbol(i);
    sym = sym.replace(/\\/g, "\\\\");
    sym = sym.replace(/\(/g, "\\(");
    sym = sym.replace(/\)/g, "\\)");
    rgb = Alphabet.lighten_colour(this.get_rgb(i));
    out += " (" + sym + ") [" + rgb.red.toFixed(4) + " " + rgb.green.toFixed(4) + " " + rgb.blue.toFixed(4) + "]\n";
  }
  out += ">> def\n";
  return out;
};

// return the alphabet name or a list of primary symbols
Alphabet.prototype.toString = function() {
  "use strict";
  if (this.name != null) {
    return this.name;
  } else {
    return this.get_symbols();
  }
};

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Helper functions
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// Convert a colour specified in RGB colourspace values into LAB colourspace
Alphabet.rgb2lab = function(rgb) {
  "use strict";
  var xyzHelper, labHelper;
  // XYZ helper
  xyzHelper = function(value) {
    if (value > 0.0445) {
      value = (value + 0.055) / 1.055;
      value = Math.pow(value, 2.4);
    } else {
      value /= 12.92;
    }
    value *= 100;
    return value;
  };
  // lab helper
  labHelper = function(value) {
    if (value > 0.008856) {
      value = Math.pow(value, 1.0 / 3.0);
    } else {
      value = (7.787 * value) + (16.0 / 116.0);
    }
    return value;
  };
  // convert into XYZ colourspace
  var c1, c2, c3;
  if (typeof rgb == "number") {
    c1 = xyzHelper(((rgb >> 16) & 0xFF) / 255.0);
    c2 = xyzHelper(((rgb >> 8) & 0xFF) / 255.0);
    c3 = xyzHelper((rgb & 0xFF) / 255.0);
  } else {
    c1 = xyzHelper(rgb.red);
    c2 = xyzHelper(rgb.green);
    c3 = xyzHelper(rgb.blue);
  }
  var x = (c1 * 0.4124) + (c2 * 0.3576) + (c3 * 0.1805);
  var y = (c1 * 0.2126) + (c2 * 0.7152) + (c3 * 0.0722);
  var z = (c1 * 0.0193) + (c2 * 0.1192) + (c3 * 0.9505);
  // convert into Lab colourspace
  c1 = labHelper(x / 95.047);
  c2 = labHelper(y / 100.0);
  c3 = labHelper(z / 108.883);
  var l = (116.0 * c2) - 16;
  var a = 500.0 * (c1 - c2);
  var b = 200.0 * (c2 - c3);
  return {"l": l, "a": a, "b": b};
};

// Convert a colour specified in HSV colourspace into RGB colourspace
Alphabet.hsv2rgb = function(hue, sat, value, output_object) {
  // achromatic (grey)
  var r = value;
  var g = value;
  var b = value;
  if (sat != 0) {
    var h = hue / 60.0;
    var i = Math.floor(h);
    var f = h - i;
    var p = value * (1.0 - sat);
    var q = value * (1.0 - (sat * f));
    var t = value * (1.0 - (sat * (1.0 - f)));
    if (i == 0) {
      r = value;
      g = t;
      b = p;
    } else if (i == 1) {
      r = q;
      g = value;
      b = p;
    } else if (i == 2) {
      r = p;
      g = value;
      b = t;
    } else if (i == 3) {
      r = p;
      g = q;
      b = value;
    } else if (i == 4) {
      r = t;
      g = p;
      b = value;
    } else {
      r = value;
      g = p;
      b = q;
    }
  }
  if (output_object) {
    return {"red": r, "green": g, "blue": b};
  } else {
    return (Math.floor(r * 255) << 15) | (Math.floor(g * 255) << 8) | (Math.floor(b * 255));
  }
};

// Calculate a distance score between two colours in LAB colourspace
Alphabet.lab_dist = function(lab1, lab2) {
  var c1 = Math.sqrt((lab1.l * lab1.l) + (lab1.a * lab1.a));
  var c2 = Math.sqrt((lab2.l * lab2.l) + (lab2.a * lab2.a));
  var dc = c1 - c2;
  var dl = lab1.l - lab2.l;
  var da = lab1.a - lab2.a;
  var db = lab1.b - lab2.b;
  // we don't want NaN due to rounding errors so fudge things a bit...
  var dh = 0;
  var dh_squared = (da * da) + (db * db) - (dc * dc);
  if (dh_squared > 0) {
    dh = Math.sqrt(dh_squared);
  }
  var first = dl;
  var second = dc / (1.0 + (0.045 * c1));
  var third = dh / (1.0 + (0.015 * c1));
  return Math.sqrt((first * first) + (second * second) + (third * third));
};

// convert an RGB value into a HSL value
Alphabet.rgb2hsl = function(rgb) {
  "use strict";
  var min, max, delta, h, s, l, r, g, b;
  if (typeof rgb == "number") {
    r = ((rgb >> 16) & 0xFF) / 255.0;
    g = ((rgb >> 8) & 0xFF) / 255.0;
    b = (rgb & 0xFF) / 255.0;
  } else {
    r = rgb.red;
    g = rgb.green;
    b = rgb.blue;
  }
  min = Math.min(r, g, b);
  max = Math.max(r, g, b);
  delta = max - min;
  l = min + (delta / 2);
  if (max == min) {
    h = 0; // achromatic (grayscale)
    s = 0;
  } else {
    if (l > 0.5) {
      s = delta / (2 - max - min);
    } else {
      s = delta / (max + min);
    }
    if (max == r) {
      h = (g - b) / delta;
      if (g < b) h += 6;
    } else if (max == g) {
      h = ((b - r) / delta) + 2;
    } else {
      h = ((r - g) / delta) + 4;
    }
    h /= 6;
  }
  return {"h": h, "s": s, "l": l};
};

// convert a HSL value into an RGB value
Alphabet.hsl2rgb = function(hsl, output_object) {
  "use strict";
  function _hue(p, q, t) {
    "use strict";
    if (t < 0) t += 1;
    else if (t > 1) t -= 1;
    if (t < (1.0 / 6.0)) {
      return p + ((q - p) * 6.0 * t);
    } else if (t < 0.5) {
      return q;
    } else if (t < (2.0 / 3.0)) {
      return p + ((q - p) * ((2.0 / 3.0) - t) * 6.0);
    } else {
      return p;
    }
  }
  var r, g, b, p, q;
  if (hsl.s == 0) {
    // achromatic (grayscale)
    r = hsl.l;
    g = hsl.l;
    b = hsl.l;
  } else {
    if (hsl.l < 0.5) {
      q = hsl.l * (1 + hsl.s);
    } else {
      q = hsl.l + hsl.s - (hsl.l * hsl.s);
    }
    p = (2 * hsl.l) - q;
    r = _hue(p, q, hsl.h + (1.0 / 3.0));
    g = _hue(p, q, hsl.h);
    b = _hue(p, q, hsl.h - (1.0 / 3.0));
  }
  if (output_object) {
    return {"red": r, "green": g, "blue": b};
  } else {
    return (Math.floor(r * 255) << 15) | (Math.floor(g * 255) << 8) | (Math.floor(b * 255));
  }
};

Alphabet.lighten_colour = function(rgb) {
  "use strict";
  var hsl = Alphabet.rgb2hsl(rgb);
  hsl.l += (1.0 - hsl.l) * 2 / 3;
  return Alphabet.hsl2rgb(hsl, typeof rgb != "number");
};

//======================================================================
// end Alphabet object
//======================================================================

//======================================================================
// start StandardAlphabet object
//======================================================================

// an extension of the alphabet object to support some additional fields 
// only present in standard alphabets.
var StandardAlphabet = function(enum_code, enum_name, alphabet_data) {
  Alphabet.apply(this, [alphabet_data]);
  this.enum_code = enum_code;
  this.enum_name = enum_name;
};
StandardAlphabet.prototype = Alphabet.prototype;
StandardAlphabet.prototype.constructor = StandardAlphabet;

// A unique code for this standard alphabet.
// This code will be a power of 2 to enable creation of bitsets for
// a selection of standard alphabets.
StandardAlphabet.prototype.get_code = function() {
  return this.enum_code;
};

// A unique name for this standard alphabet.
// this name will be all upper case and the same as the property that
// refers to this alphabet in the AlphStd collection.
StandardAlphabet.prototype.get_enum = function() {
  return this.enum_name;
};

//======================================================================
// end StandardAlphabet object
//======================================================================

// A collection of standard alphabets.
var AlphStd = {
  RNA: new StandardAlphabet(1, "RNA", {
    "name": "RNA",
    "like": "RNA",
    "ncore": 4,
    "symbols": [
      {"symbol": "A", "name": "Adenine", "colour": "CC0000"},
      {"symbol": "C", "name": "Cytosine", "colour": "0000CC"},
      {"symbol": "G", "name": "Guanine", "colour": "FFB300"},
      {"symbol": "U", "name": "Uracil", "colour": "008000",
        "aliases": "T"},
      {"symbol": "N", "name": "Any base", "equals": "ACGU", "aliases": "X."},
      {"symbol": "V", "name": "Not U", "equals": "ACG"},
      {"symbol": "H", "name": "Not G", "equals": "ACU"},
      {"symbol": "D", "name": "Not C", "equals": "AGU"},
      {"symbol": "B", "name": "Not A", "equals": "CGU"},
      {"symbol": "M", "name": "Amino", "equals": "AC"},
      {"symbol": "R", "name": "Purine", "equals": "AG"},
      {"symbol": "W", "name": "Weak", "equals": "AU"}, 
      {"symbol": "S", "name": "Strong", "equals": "CG"},
      {"symbol": "Y", "name": "Pyrimidine", "equals": "CU"},
      {"symbol": "K", "name": "Keto", "equals": "GU"}
    ]
  }), 
  DNA: new StandardAlphabet(2, "DNA", {
    "name": "DNA",
    "like": "DNA",
    "ncore": 4,
    "symbols": [
      {"symbol": "A", "name": "Adenine", "colour": "CC0000", "complement": "T"},
      {"symbol": "C", "name": "Cytosine", "colour": "0000CC", "complement": "G"},
      {"symbol": "G", "name": "Guanine", "colour": "FFB300", "complement": "C"},
      {"symbol": "T", "name": "Thymine", "colour": "008000", "complement": "A",
        "aliases": "U"},
      {"symbol": "N", "name": "Any base", "equals": "ACGT", "aliases": "X."},
      {"symbol": "V", "name": "Not T", "equals": "ACG"},
      {"symbol": "H", "name": "Not G", "equals": "ACT"},
      {"symbol": "D", "name": "Not C", "equals": "AGT"},
      {"symbol": "B", "name": "Not A", "equals": "CGT"},
      {"symbol": "M", "name": "Amino", "equals": "AC"},
      {"symbol": "R", "name": "Purine", "equals": "AG"},
      {"symbol": "W", "name": "Weak", "equals": "AT"}, 
      {"symbol": "S", "name": "Strong", "equals": "CG"},
      {"symbol": "Y", "name": "Pyrimidine", "equals": "CT"},
      {"symbol": "K", "name": "Keto", "equals": "GT"}
    ]
  }), 
  PROTEIN: new StandardAlphabet(4, "PROTEIN", {
    "name": "Protein",
    "like": "PROTEIN",
    "ncore": 20,
    "symbols": [
      {"symbol": "A", "name": "Alanine", "colour": "0000CC"},
      {"symbol": "C", "name": "Cysteine", "colour": "0000CC"},
      {"symbol": "D", "name": "Aspartic acid", "colour": "FF00FF"},
      {"symbol": "E", "name": "Glutamic acid", "colour": "FF00FF"},
      {"symbol": "F", "name": "Phenylalanine", "colour": "0000CC"},
      {"symbol": "G", "name": "Glycine", "colour": "FFB300"},
      {"symbol": "H", "name": "Histidine", "colour": "FFCCCC"},
      {"symbol": "I", "name": "Isoleucine", "colour": "0000CC"},
      {"symbol": "K", "name": "Lysine", "colour": "CC0000"},
      {"symbol": "L", "name": "Leucine", "colour": "0000CC"},
      {"symbol": "M", "name": "Methionine", "colour": "0000CC"},
      {"symbol": "N", "name": "Asparagine", "colour": "008000"},
      {"symbol": "P", "name": "Proline", "colour": "FFFF00"},
      {"symbol": "Q", "name": "Glutamine", "colour": "008000"},
      {"symbol": "R", "name": "Arginine", "colour": "CC0000"},
      {"symbol": "S", "name": "Serine", "colour": "008000"},
      {"symbol": "T", "name": "Threonine", "colour": "008000"},
      {"symbol": "V", "name": "Valine", "colour": "0000CC"},
      {"symbol": "W", "name": "Tryptophan", "colour": "0000CC"},
      {"symbol": "Y", "name": "Tyrosine", "colour": "33E6CC"},
      {"symbol": "X", "name": "Any amino acid", "equals": "ACDEFGHIKLMNPQRSTVWY", "aliases": "*."},
      {"symbol": "B", "name": "Asparagine or Aspartic acid", "equals": "DN"}, 
      {"symbol": "Z", "name": "Glutamine or Glutamic acid", "equals": "EQ"}, 
      {"symbol": "J", "name": "Leucine or Isoleucine", "equals": "IL"}
    ]
  })
};

//======================================================================
// start Symbol object
//======================================================================
var Symbol = function(alph_index, scale, alphabet) {
  "use strict";
  //variable prototype
  this.symbol = alphabet.get_symbol(alph_index);
  this.scale = scale;
  this.colour = alphabet.get_colour(alph_index);
};

Symbol.prototype.get_symbol = function() {
  "use strict";
  return this.symbol;
};

Symbol.prototype.get_scale = function() {
  "use strict";
  return this.scale;
};

Symbol.prototype.get_colour = function() {
  "use strict";
  return this.colour;
};

Symbol.prototype.toString = function() {
  "use strict";
  return this.symbol + " " + (Math.round(this.scale*1000)/10) + "%";
};

function compare_symbol(sym1, sym2) {
  "use strict";
  if (sym1.get_scale() < sym2.get_scale()) {
    return -1;
  } else if (sym1.get_scale() > sym2.get_scale()) {
    return 1;
  } else {
    return 0;
  }
}
//======================================================================
// end Symbol object
//======================================================================

//======================================================================
// start Pspm object
//======================================================================
var Pspm = function(matrix, name, ltrim, rtrim, nsites, evalue, pssm, alt) {
  "use strict";
  var row, col, data, row_sum, delta, evalue_re;
  if (typeof name !== "string") {
    name = "";
  }
  this.name = name;
  //construct
  if (matrix instanceof Pspm) {
    // copy constructor
    this.alph_length = matrix.alph_length;
    this.motif_length = matrix.motif_length;
    this.name = matrix.name;
    this.alt = matrix.alt;
    this.nsites = matrix.nsites;
    this.evalue = matrix.evalue;
    this.ltrim = matrix.ltrim;
    this.rtrim = matrix.rtrim;
    this.pspm = [];
    for (row = 0; row < matrix.motif_length; row++) {
      this.pspm[row] = [];
      for (col = 0; col < matrix.alph_length; col++) {
        this.pspm[row][col] = matrix.pspm[row][col];
      }
    }
    if (matrix.pssm != null) {
      this.pssm = [];
      for (row = 0; row < matrix.motif_length; row++) {
        this.pspm[row] = [];
        for (col = 0; col < matrix.alph_length; col++) {
          this.pssm[row][col] = matrix.pssm[row][col];
        }
      }
    }
  } else {
    // check parameters
    if (ltrim == null) {
      ltrim = 0;
    } else if (typeof ltrim !== "number" || ltrim % 1 !== 0 || ltrim < 0) {
      throw new Error("ltrim must be a non-negative integer, got: " + ltrim);
    }
    if (rtrim == null) {
      rtrim = 0;
    } else if (typeof rtrim !== "number" || rtrim % 1 !== 0 || rtrim < 0) {
      throw new Error("rtrim must be a non-negative integer, got: " + rtrim);
    }
    if (nsites != null) {
      if (typeof nsites !== "number" || nsites < 0) {
        throw new Error("nsites must be a positive number, got: " + nsites);
      } else if (nsites == 0) {
        nsites = null;
      }
    }
    if (evalue != null) {
      if (typeof evalue === "number") {
        if (evalue < 0) {
          throw new Error("evalue must be a non-negative number, got: " + evalue);
        }
      } else if (typeof evalue === "string") {
        evalue_re = /^((?:[+]?[0-9]*\.?[0-9]+(?:[eE][-+]?[0-9]+)?)|inf)$/;
        if (!evalue_re.test(evalue)) {
          throw new Error("evalue must be a non-negative number, got: " + evalue);
        }
      } else {
        throw new Error("evalue must be a non-negative number, got: " + evalue);
      }
    }
    // set properties
    this.name = name;
    this.alt = alt;
    this.nsites = nsites;
    this.evalue = evalue;
    this.ltrim = ltrim;
    this.rtrim = rtrim;
    if (typeof matrix === "string") {
      // string constructor
      data = parse_pspm_string(matrix);
      this.alph_length = data["alph_length"];
      this.motif_length = data["motif_length"];
      this.pspm = data["pspm"];
      if (this.evalue == null) {
        if (data["evalue"] != null) {
          this.evalue = data["evalue"];
        } else {
          this.evalue = 0;
        }
      }
      if (this.nsites == null) {
        if (typeof data["nsites"] === "number") {
          this.nsites = data["nsites"];
        } else {
          this.nsites = 20;
        }
      }
    } else {
      // assume pspm is a nested array
      this.motif_length = matrix.length;
      this.alph_length = (matrix.length > 0 ? matrix[0].length : 0);
      if (this.nsites == null) {
        this.nsites = 20;
      }
      if (this.evalue == null) {
        this.evalue = 0;
      }
      this.pspm = [];
      // copy pspm and check
      for (row = 0; row < this.motif_length; row++) {
        if (this.alph_length != matrix[row].length) {
          throw new Error("COLUMN_MISMATCH");
        }
        this.pspm[row] = [];
        row_sum = 0;
        for (col = 0; col < this.alph_length; col++) {
          this.pspm[row][col] = matrix[row][col];
          row_sum += this.pspm[row][col];
        }
        delta = 0.1;
        if (isNaN(row_sum) || (row_sum > 1 && (row_sum - 1) > delta) || 
            (row_sum < 1 && (1 - row_sum) > delta)) {
          throw new Error("INVALID_SUM");
        }
      }
      // copy pssm
      if (pssm != null) {
        this.pssm = [];
        for (row = 0; row < this.motif_length; row++) {
          this.pssm[row] = [];
          for (col = 0; col < this.alph_length; col++) {
            this.pssm[row][col] = pssm[row][col];
          }
        }
      }
    }
  }
};

Pspm.prototype.copy = function() {
  "use strict";
  return new Pspm(this);
};

Pspm.prototype.reverse = function() {
  "use strict";
  var x, y, temp, temp_trim;
  //reverse
  x = 0;
  y = this.motif_length-1;
  while (x < y) {
    temp = this.pspm[x];
    this.pspm[x] = this.pspm[y];
    this.pspm[y] = temp;
    x++;
    y--;
  }
  // reverse pssm (if defined)
  if (typeof this.pssm !== "undefined") {
    //reverse
    x = 0;
    y = this.motif_length-1;
    while (x < y) {
      temp = this.pssm[x];
      this.pspm[x] = this.pssm[y];
      this.pssm[y] = temp;
      x++;
      y--;
    }
  }
  //swap triming
  temp_trim = this.ltrim;
  this.ltrim = this.rtrim;
  this.rtrim = temp_trim;
  return this; //allow function chaining...
};

Pspm.prototype.reverse_complement = function(alphabet) {
  "use strict";
  var x, y, temp, i, row, c, temp_trim;
  if (this.alph_length != alphabet.get_size_core()) {
    throw new Error("The alphabet size does not match the size of the pspm.");
  }
  if (!alphabet.has_complement()) {
    throw new Error("The specified alphabet can not be complemented.");
  }
  // reverse motif
  this.reverse();
  //complement
  for (x = 0; x < this.motif_length; x++) {
    row = this.pspm[x];
    for (i = 0; i < row.length; i++) {
      c = alphabet.get_complement(i);
      if (c < i) continue;
      temp = row[i];
      row[i] = row[c];
      row[c] = temp;
    }
  }
  // complement pssm (if defined)
  if (typeof this.pssm !== "undefined") {
    //complement
    for (x = 0; x < this.motif_length; x++) {
      row = this.pssm[x];
      for (i = 0; i < row.length; i++) {
        c = alphabet.get_complement(i);
        if (c < i) continue;
        temp = row[i];
        row[i] = row[c];
        row[c] = temp;
      }
    }
  }
  return this; //allow function chaining...
};

Pspm.prototype.get_stack = function(position, alphabet, ssc) {
  "use strict";
  var row, stack_ic, alphabet_ic, stack, i, sym;
  if (this.alph_length != alphabet.get_size_core()) {
    throw new Error("The alphabet size does not match the size of the pspm.");
  }
  row = this.pspm[position];
  stack_ic = this.get_stack_ic(position, alphabet);
  if (ssc) stack_ic -= this.get_error(alphabet);
  alphabet_ic = alphabet.get_ic();
  stack = [];
  for (i = 0; i < this.alph_length; i++) {
    sym = new Symbol(i, row[i]*stack_ic/alphabet_ic, alphabet);
    if (sym.get_scale() <= 0) {
      continue;
    }
    stack.push(sym);
  }
  stack.sort(compare_symbol);
  return stack;
};

Pspm.prototype.get_stack_ic = function(position, alphabet) {
  "use strict";
  var row, H, i;
  if (this.alph_length != alphabet.get_size_core()) {
    throw new Error("The alphabet size does not match the size fo the pspm.");
  }
  row = this.pspm[position];
  H = 0;
  for (i = 0; i < this.alph_length; i++) {
    if (row[i] === 0) {
      continue;
    }
    H -= (row[i] * (Math.log(row[i]) / Math.LN2));
  }
  return alphabet.get_ic() - H;
};

Pspm.prototype.get_error = function(alphabet) {
  "use strict";
  if (this.nsites === 0) {
    return 0;
  }
  return (alphabet.get_size_core()-1) / (2 * Math.LN2 * this.nsites);
};

Pspm.prototype.get_motif_length = function() {
  "use strict";
  return this.motif_length;
};

Pspm.prototype.get_alph_length = function() {
  "use strict";
  return this.alph_length;
};

Pspm.prototype.get_left_trim = function() {
  "use strict";
  return this.ltrim;
};

Pspm.prototype.get_right_trim = function() {
  "use strict";
  return this.rtrim;
};

Pspm.prototype.as_best_match = function(alphabet) {
  "use strict";
  var match, odds, best_odds, best_index;
  var i, j;
  match = "";
  for (i = 0; i < this.motif_length; i++) {
    best_index = 0;
    best_odds = this.pspm[i][0] / alphabet.get_bg_freq(0);
    for (j = 1; j < this.alph_length; j++) {
      odds = this.pspm[i][j] / alphabet.get_bg_freq(j);
      if (odds > best_odds) {
        best_odds = odds;
        best_index = j;
      }
    }
    match += alphabet.get_symbol(best_index);
  }
  return match;
};

Pspm.prototype.as_count_matrix = function() {
  "use strict";
  var count, count_text, text;
  var i, j;
  text = "";
  for (i = 0; i < this.motif_length; i++) {
    if (i !== 0) {
      text += "\n";
    }
    for (j = 0; j < this.alph_length; j++) {
      if (j !== 0) {
        text += " ";
      }
      count = Math.round(this.nsites * this.pspm[i][j]);
      count_text = "" + count;
      // pad up to length of 4
      if (count_text.length < 4) {
        text += (new Array(5 - count_text.length)).join(" ") + count_text;
      } else {
        text += count_text;
      }
    }
  }
  return text; 
};

Pspm.prototype.as_probability_matrix = function() {
  "use strict";
  var text;
  var i, j;
  text = "";
  for (i = 0; i < this.motif_length; i++) {
    if (i !== 0) {
      text += "\n";
    }
    for (j = 0; j < this.alph_length; j++) {
      if (j !== 0) {
        text += " ";
      }
      text += this.pspm[i][j].toFixed(6);
    }
  }
  return text; 
};

Pspm.prototype.as_score_matrix = function(alphabet, pseudo) {
  "use strict";
  var me, score, out, row, col, score_text;
  me = this;
  if (typeof this.pssm === "undefined") {
    if (!(typeof alphabet === "object" && alphabet != null && alphabet instanceof Alphabet)) {
      throw new Error("The alphabet is required to generate the pssm.");
    }
    if (typeof pseudo === "undefined") {
      pseudo = 0.01;
    } else if (typeof pseudo !== "number" || pseudo < 0) {
      throw new Error("Expected positive number for pseudocount");
    }
    score = function(row, col) {
      "use strict";
      var p, bg, p2;
      p = me.pspm[row][col];
      bg = alphabet.get_bg_freq(col);
      p2 = (p * me.nsites + bg * pseudo) / (me.nsites + pseudo);
      return (p2 > 0 ? Math.round((Math.log(p2 / bg) / Math.LN2) * 100) : -10000);
    };
  } else {
    score = function(row, col) {
      "use strict";
      return me.pssm[row][col];
    };
  }
  out = "";
  for (row = 0; row < this.motif_length; row++) {
    for (col = 0; col < this.alph_length; col++) {
      if (col !== 0) {
        out += " ";
      }
      score_text = "" + score(row, col);
      // pad out to 6 characters
      if (score_text.length < 6) {
        out += (new Array(7 - score_text.length)).join(" ") + score_text;
      } else {
        out += score_text;
      }
    }
    out += "\n";
  }
  return out;
}

Pspm.prototype.as_pspm = function() {
  "use strict";
  return "letter-probability matrix: alength= " + this.alph_length + 
      " w= " + this.motif_length + " nsites= " + this.nsites + 
      " E= " + (typeof this.evalue === "number" ? 
          this.evalue.toExponential() : this.evalue) + "\n" +
      this.as_probability_matrix();
};

Pspm.prototype.as_pssm = function(alphabet, pseudo) {
  "use strict";
  return "log-odds matrix: alength= " + this.alph_length + 
      " w= " + this.motif_length + 
      " E= " + (typeof this.evalue == "number" ?
          this.evalue.toExponential() : this.evalue) + "\n" +
      this.as_score_matrix(alphabet, pseudo);
};

Pspm.prototype.as_meme = function(options) {
  var with_header, with_pspm, with_pssm, version, alphabet, bg_source, pseudocount, strands;
  var out, alen, i;
  // get the options
  if (typeof options !== "object" || options === null) {
    options = {};
  }
  with_header = (typeof options["with_header"] === "boolean" ? options["with_header"] : false);
  with_pspm = (typeof options["with_pspm"] === "boolean" ? options["with_pspm"] : false);
  with_pssm = (typeof options["with_pssm"] === "boolean" ? options["with_pssm"] : false);
  if (!with_pspm && !with_pssm) with_pspm = true;
  if (with_header) {
    if (typeof options["version"] === "string" && /^\d+(?:\.\d+){0,2}$/.test(options["version"])) {
      version = options["version"];
    } else if (typeof options["version"] === "number") {
      version = options["version"].toFixed(0);
    } else {
      version = "4";
    }
    if (typeof options["strands"] === "number" && options["strands"] === 1) {
      strands = 1;
    } else {
      strands = 2;
    }
    if (typeof options["bg_source"] === "string") {
      bg_source = options["bg_source"];
    } else {
      bg_source = "unknown source";
    }
    if (typeof options["alphabet"] === "object" && options["alphabet"] != null
        && options["alphabet"] instanceof Alphabet) {
      alphabet = options["alphabet"];
    } else {
      throw new Error("The alphabet is required to generate the header.");
    }
  }
  // now create the output
  out = "";
  if (with_header) {
    out = "MEME version " + version + "\n\n";
    out += alphabet.as_meme() + "\n";
    if (alphabet.has_complement()) { // assume DNA has both strands unless otherwise specified
      out += "strands: " + (strands === 1 ? "+" : "+ -") + "\n\n";
    }
    out += "Background letter frequencies (from " + bg_source + "):\n";
    alen = alphabet.get_size_core();
    for (i = 0; i < alen; i++) {
      if (i !== 0) {
        if (i % 9 === 0) { // maximum of nine entries per line
          out += "\n";
        } else {
          out += " ";
        }
      }
      out += alphabet.get_symbol(i) + " " + alphabet.get_bg_freq(i).toFixed(3);
    }
  }
  out += "\n\n";
  out += "MOTIF " + this.name + (this.alt == null ? "" : " " + this.alt);
  if (with_pssm) {
    out += "\n\n";
    out += this.as_pssm(options["alphabet"], options["pseudocount"]);
  }
  if (with_pspm) {
    out += "\n\n";
    out += this.as_pspm();
  }
  return out;
}

Pspm.prototype.toString = function() {
  "use strict";
  var str, i, row;
  str = "";
  for (i = 0; i < this.pspm.length; i++) {
    row = this.pspm[i];
    str += row.join("\t") + "\n";
  }
  return str;
};

function parse_pspm_properties(str) {
  "use strict";
  var parts, i, eqpos, before, after, properties, prop, num, num_re;
  num_re = /^((?:[+]?[0-9]*\.?[0-9]+(?:[eE][-+]?[0-9]+)?)|inf)$/;
  parts = trim(str).split(/\s+/);
  // split up words containing =
  for (i = 0; i < parts.length;) {
    eqpos = parts[i].indexOf("=");
    if (eqpos != -1) {
      before = parts[i].substr(0, eqpos);
      after = parts[i].substr(eqpos+1);
      if (before.length > 0 && after.length > 0) {
        parts.splice(i, 1, before, "=", after);
        i += 3;
      } else if (before.length > 0) {
        parts.splice(i, 1, before, "=");
        i += 2;
      } else if (after.length > 0) {
        parts.splice(i, 1, "=", after);
        i += 2;
      } else {
        parts.splice(i, 1, "=");
        i++;
      }
    } else {
      i++;
    }
  }
  properties = {};
  for (i = 0; i < parts.length; i += 3) {
    if (parts.length - i < 3) {
      throw new Error("Expected PSPM property was incomplete. "+
          "Remaing parts are: " + parts.slice(i).join(" "));
    }
    if (parts[i+1] !== "=") {
      throw new Error("Expected '=' in PSPM property between key and " +
          "value but got " + parts[i+1]); 
    }
    prop = parts[i].toLowerCase();
    num = parts[i+2];
    if (!num_re.test(num)) {
      throw new Error("Expected numeric value for PSPM property '" + 
          prop + "' but got '" + num + "'");
    }
    properties[prop] = num;
  }
  return properties;
}

function parse_pspm_string(pspm_string) {
  "use strict";
  var header_re, lines, first_line, line_num, col_num, alph_length, 
      motif_length, nsites, evalue, pspm, i, line, match, props, parts,
      j, prob;
  header_re = /^letter-probability\s+matrix:(.*)$/i;
  lines = pspm_string.split(/\n/);
  first_line = true;
  line_num = 0;
  col_num = 0;
  alph_length;
  motif_length;
  nsites;
  evalue;
  pspm = [];
  for (i = 0; i < lines.length; i++) {
    line = trim(lines[i]);
    if (line.length === 0) { 
      continue;
    }
    // check the first line for a header though allow matrices without it
    if (first_line) {
      first_line = false;
      match = header_re.exec(line);
      if (match !== null) {
        props = parse_pspm_properties(match[1]);
        if (props.hasOwnProperty("alength")) {
          alph_length = parseFloat(props["alength"]);
          if (alph_length != 4 && alph_length != 20) {
            throw new Error("PSPM property alength should be 4 or 20" +
                " but got " + alph_length);
          }
        }
        if (props.hasOwnProperty("w")) {
          motif_length = parseFloat(props["w"]);
          if (motif_length % 1 !== 0 || motif_length < 1) {
            throw new Error("PSPM property w should be an integer larger " +
                "than zero but got " + motif_length);
          }
        }
        if (props.hasOwnProperty("nsites")) {
          nsites = parseFloat(props["nsites"]);
          if (nsites <= 0) {
            throw new Error("PSPM property nsites should be larger than " +
                "zero but got " + nsites);
          }
        }
        if (props.hasOwnProperty("e")) {
          evalue = props["e"];
          if (evalue < 0) {
            throw new Error("PSPM property evalue should be " +
                "non-negative but got " + evalue);
          }
        }
        continue;
      }
    }
    pspm[line_num] = [];
    col_num = 0;
    parts = line.split(/\s+/);
    for (j = 0; j < parts.length; j++) {
      prob = parseFloat(parts[j]);
      if (prob != parts[j] || prob < 0 || prob > 1) {
        throw new Error("Expected probability but got '" + parts[j] + "'"); 
      }
      pspm[line_num][col_num] = prob;
      col_num++;
    }
    line_num++;
  }
  if (typeof motif_length === "number") {
    if (pspm.length != motif_length) {
      throw new Error("Expected PSPM to have a motif length of " + 
          motif_length + " but it was actually " + pspm.length);
    }
  } else {
    motif_length = pspm.length;
  }
  if (typeof alph_length !== "number") {
    alph_length = pspm[0].length;
    if (alph_length != 4 && alph_length != 20) {
      throw new Error("Expected length of first row in the PSPM to be " +
          "either 4 or 20 but got " + alph_length);
    }
  }
  for (i = 0; i < pspm.length; i++) {
    if (pspm[i].length != alph_length) {
      throw new Error("Expected PSPM row " + i + " to have a length of " + 
          alph_length + " but the length was " + pspm[i].length);
    }
  }
  return {"pspm": pspm, "motif_length": motif_length, 
    "alph_length": alph_length, "nsites": nsites, "evalue": evalue};
}
//======================================================================
// end Pspm object
//======================================================================

//======================================================================
// start Logo object
//======================================================================

var Logo = function(alphabet, options) {
  "use strict";
  this.alphabet = alphabet;
  this.fine_text = "";
  this.x_axis = 1;
  this.y_axis = true;
  this.xlate_nsyms = 1;
  this.xlate_start = null;
  this.xlate_end = null;
  this.pspm_list = [];
  this.pspm_column = [];
  this.rows = 0;
  this.columns = 0;
  if (typeof options === "string") {
    // the old method signature had fine_text here so we support that
    this.fine_text = options;
  } else if (typeof options === "object" && options != null) {
    this.fine_text = (typeof options.fine_text === "string" ? options.fine_text : "");
    this.x_axis = (typeof options.x_axis === "boolean" ? (options.x_axis ? 1 : 0) : 1);
    if (options.x_axis_hidden != null && options.x_axis_hidden) this.x_axis = -1;
    this.y_axis = (typeof options.y_axis === "boolean" ? options.y_axis : true);
    this.xlate_nsyms = (typeof options.xlate_nsyms === "number" ? options.xlate_nsyms : this.xlate_nsyms);
    this.xlate_start = (typeof options.xlate_start === "number" ? options.xlate_start : this.xlate_start);
    this.xlate_end = (typeof options.xlate_end === "number" ? options.xlate_end : this.xlate_end);
  }
};

Logo.prototype.add_pspm = function(pspm, column) {
  "use strict";
  var col;
  if (typeof column === "undefined") {
    column = 0;
  } else if (column < 0) {
    throw new Error("Column index out of bounds.");
  }
  this.pspm_list[this.rows] = pspm;
  this.pspm_column[this.rows] = column;
  this.rows++;
  col = column + pspm.get_motif_length();
  if (col > this.columns) {
    this.columns = col;
  }
};

Logo.prototype.get_columns = function() {
  "use strict";
  return this.columns;
};

Logo.prototype.get_xlate_nsyms = function() {
  "use strict";
  return this.xlate_nsyms;
};

Logo.prototype.get_xlate_start = function() {
  "use strict";
  return (this.xlate_start != null ? this.xlate_start : 0);
};

Logo.prototype.get_xlate_end = function() {
  "use strict";
  return (this.xlate_end != null ? this.xlate_end : this.columns * this.xlate_nsyms);
};

Logo.prototype.get_xlate_columns = function() {
  "use strict";
  return this.get_xlate_end() - this.get_xlate_start();
};

Logo.prototype.get_rows = function() {
  "use strict";
  return this.rows;
};

Logo.prototype.get_pspm = function(row_index) {
  "use strict";
  if (row_index < 0 || row_index >= this.rows) {
    throw new Error("INDEX_OUT_OF_BOUNDS");
  }
  return this.pspm_list[row_index];
};

Logo.prototype.get_offset = function(row_index) {
  "use strict";
  if (row_index < 0 || row_index >= this.rows) {
    throw new Error("INDEX_OUT_OF_BOUNDS");
  }
  return this.pspm_column[row_index];
};

Logo.prototype._as_eps_data = function(ssc, errbars) {
  var i, j, pos, stack_pos, pspm, stack, sym, out;
  out = "";
  for (i = 0; i < this.rows; i++) {
    out += "\nStartLine\n";
    // Indent
    for (j = 0; j < this.pspm_column[i]; j++) {
      out += "() startstack\nendstack\n\n";
    }
    pspm = this.pspm_list[i];
    if (pspm.get_left_trim() > 0) {
      out += "MuteColour\nDrawTrimEdge\n" + pspm.get_left_trim() + " DrawTrimBg\n";
    }
    for (pos = 0; pos < pspm.get_motif_length(); pos++) {
      if (pos != 0 && pos == pspm.get_left_trim()) { // enable full colour
        out += "DrawTrimEdge\nRestoreColour\n";
      } else if (pos == (pspm.get_motif_length() - pspm.get_right_trim())) {
        out += "MuteColour\n" + pspm.get_right_trim() + " DrawTrimBg\n";
      }
      out += "(" + (pos + 1) + ") startstack\n";
      stack = pspm.get_stack(pos, this.alphabet, ssc);
      for (stack_pos = 0; stack_pos < stack.length; stack_pos++) {
        sym = stack[stack_pos];
        out += " " + (sym.get_scale() * this.alphabet.get_ic()) + " (" + sym.get_symbol() + ") numchar\n";
      }
      if (errbars) {
        out += " " + pspm.get_error(this.alphabet) + " Ibeam\n";
      }
      out += "endstack\n\n";
    }
    if (pspm.get_right_trim() > 0 || pspm.get_left_trim() == pspm.get_motif_length()) {
      out += "RestoreColour\n";
    }
    out += "EndLine\n";
  }
  return out;
};

Logo.prototype.as_eps = function(options) {
  "use strict";
  if (this.xlate_nsyms != 1) throw new Error("Unsupported setting xlate_nsyms for EPS");
  if (this.xlate_start != null) throw new Error("Unsupported setting xlate_start for EPS");
  if (this.xlate_end != null) throw new Error("Unsupported setting xlate_end for EPS");

  var LOGOHEIGHT = 7.5; // default height of line in cm
  var cm2pts, height, width, now, ssc, errbars;
  if (typeof options === "undefined") {
    options = {};
  }
  cm2pts = 72 / 2.54;
  if (typeof options.logo_height == "number") {
    height = options.logo_height;
  } else {
    height = LOGOHEIGHT * this.rows;
  }
  if (typeof options.logo_width == "number") {
    width = options.logo_width;
  } else {
    width = this.columns + 2;
  }
  now = new Date();
  ssc = (typeof options.ssc == "boolean" ? options.ssc : false);
  errbars = (typeof options.show_error_bar == "boolean" ? options.show_error_bar : ssc);
  var values = {
    "LOGOHEIGHT": height,
    "LOGOWIDTH": width,
    "BOUNDINGHEIGHT": Math.round(height * cm2pts),
    "BOUNDINGWIDTH": Math.round(width * cm2pts),
    "LOGOLINEHEIGHT": (height / this.rows),
    "CHARSPERLINE": this.columns,
    "BARBITS": this.alphabet.get_ic(),
    "LOGOTYPE": (this.alphabet.has_complement() ? "NA" : "AA"),
    "CREATIONDATE": now.getDate() + "." + (now.getMonth() + 1) + "." + now.getFullYear() + " " + now.getHours() + ":" + now.getMinutes() + ":" + now.getSeconds(),
    "ERRORBARFRACTION": (typeof options.error_bar_fraction == "number" ? options.error_bar_fraction : 1.0),
    "TICBITS": (typeof options.ticbits == "number" ? options.ticbits : 1.0),
    "TITLE": (typeof options.title == "string" ? options.title : ""),
    "FINEPRINT": (typeof options.fineprint == "string" ? options.fineprint : this.fine_text),
    "XAXISLABEL": (typeof options.xaxislabel == "string" ? options.xaxislabel : ""),
    "YAXISLABEL": (typeof options.yaxislabel == "string" ? options.yaxislabel : "bits"),
    "SSC": ssc,
    "YAXIS": (typeof options.show_y_axis == "boolean" ? options.show_y_axis : this.y_axis),
    "SHOWENDS": (typeof options.show_ends == "boolean" ? options.show_ends : false),
    "ERRBAR": errbars,
    "OUTLINE": (typeof options.show_outline == "boolean" ? options.show_outline : false),
    "NUMBERING": (typeof options.show_numbering == "boolean" ? options.show_numbering : this.x_axis != 0),
    "SHOWINGBOX": (typeof options.show_box == "boolean" ? options.show_box : false),
    "CREATOR": (typeof options.creator == "string" ? options.creator : "motif_logo.js"),
    "FONTSIZE": (typeof options.label_font_size == "number" ? options.label_font_size : 12),
    "TITLEFONTSIZE": (typeof options.title_font_size == "number" ? options.title_font_size : 12),
    "SMALLFONTSIZE": (typeof options.small_font_size == "number" ? options.small_font_size : 6),
    "TOPMARGIN" : (typeof options.top_margin == "number" ? options.top_margin : 0.9),
    "BOTTOMMARGIN": (typeof options.bottom_margin == "number" ? options.bottom_margin : 0.9),
    "COLORDICT": this.alphabet._as_eps_dict(),
    "DATA": this._as_eps_data(ssc, errbars)
  };
  // now this requires that the script containing the template has been imported!
  return motif_logo_template(values);
};

//======================================================================
// end Logo object
//======================================================================

// calculate the exact size (in pixels) of an object drawn on the
// canvas assuming that the background of the canvas is transparent.
function canvas_bounds(ctx, cwidth, cheight) {
  "use strict";
  var data, r, c, top_line, bottom_line, left_line, right_line, 
      txt_width, txt_height;

  // extract the image data
  data = ctx.getImageData(0, 0, cwidth, cheight).data;

  // set initial values
  top_line = -1; bottom_line = -1; left_line = -1; right_line = -1;
  txt_width = 0; txt_height = 0;

  // Find the top-most line with a non-transparent pixel
  for (r = 0; r < cheight; r++) {
    for (c = 0; c < cwidth; c++) {
      if (data[r * cwidth * 4 + c * 4 + 3]) {
        top_line = r;
        break;
      }
    }
    if (top_line != -1) {
      break;
    }
  }
  
  // Only bother looking if we found at least one set pixel... 
  if (top_line != -1) {

    //find the last line with a non-transparent pixel
    for (r = cheight-1; r >= top_line; r--) {
      for(c = 0; c < cwidth; c++) {
        if(data[r * cwidth * 4 + c * 4 + 3]) {
          bottom_line = r;
          break;
        }
      }
      if (bottom_line != -1) {
        break;
      }
    }
    // calculate height
    txt_height = bottom_line - top_line + 1;

    // Find the left-most line with a non-transparent pixel
    for (c = 0; c < cwidth; c++) {
      for (r = top_line; r <= bottom_line; r++) {
        if (data[r * cwidth * 4 + c * 4 + 3]) {
          left_line = c;
          break;
        }
      }
      if (left_line != -1) {
        break;
      }
    }

    //find the right most line with a non-transparent pixel
    for (c = cwidth-1; c >= left_line; c--) {
      for(r = top_line; r <= bottom_line; r++) {
        if(data[r * cwidth * 4 + c * 4 + 3]) {
          right_line = c;
          break;
        }
      }
      if (right_line != -1) {
        break;
      }
    }
    txt_width = right_line - left_line + 1;
  }

  //return the bounds
  return {bound_top: top_line, bound_bottom: bottom_line, 
    bound_left: left_line, bound_right: right_line, width: txt_width, 
    height: txt_height};
}

//======================================================================
// start RasterizedAlphabet
//======================================================================

// Rasterize Alphabet
// 1) Measure width of text at default font for all symbols in alphabet
// 2) sort in width ascending
// 3) Drop the top and bottom 10% (designed to ignore outliers like 'W' and 'I')
// 4) Calculate the average as the maximum scaling factor (designed to stop I becoming a rectangular blob).
// 5) Assume scale of zero would result in width of zero, interpolate scale required to make perfect width font
// 6) Draw text onto temp canvas at calculated scale
// 7) Find bounds of drawn text
// 8) Paint on to another canvas at the desired height (but only scaling width to fit if larger).
var RasterizedAlphabet = function(alphabet, logo_scale, font, width) {
  "use strict";
  var default_size, safety_pad, canvas, ctx, middle, baseline, widths, sizes,
      i, sym, size, tenpercent, avg_width, scale, 
      target_width, target_height;
  //variable prototypes
  this.alphabet = alphabet;
  this.scale = logo_scale;
  this.sym_cache = {};
  this.stack_num_cache = [];
  this.scale_num_cache = [];
  // size of canvas
  default_size = 60; // size of measuring canvas
  safety_pad = 20; // pixels to pad around so we don't miss the edges
  // create a canvas to do our measuring
  canvas = document.createElement("canvas");
  if (!canvas.getContext) throw new Error("No canvas support");
  canvas.width = default_size + 2 * safety_pad;
  canvas.height = default_size + 2 * safety_pad;
  middle = Math.round(canvas.width / 2);
  baseline = Math.round(canvas.height - safety_pad);
  ctx = canvas.getContext('2d');
  if (!supports_text(ctx)) throw new Error("Canvas does not support text");
  ctx.font = font;
  ctx.textAlign = "center";
  ctx.translate(middle, baseline);
  // list of widths
  widths = [];
  sizes = [];
  //now measure each letter in the alphabet
  for (i = 0; i < alphabet.get_size_core(); ++i) {
    // reset the canvas
    ctx.clearRect(0, 0, canvas.width, canvas.height);
    ctx.fillStyle = alphabet.get_colour(i);
    // draw the test text
    ctx.fillText(alphabet.get_symbol(i), 0, 0);
    //measure
    size = canvas_bounds(ctx, canvas.width, canvas.height);
    if (size.width === 0) throw new Error("Invisible symbol!");
    widths.push(size.width);
    sizes[i] = size;
  }
  //sort the widths
  widths.sort(function(a,b) {return a - b;});
  //drop 10% of the items off each end
  tenpercent = Math.floor(widths.length / 10);
  for (i = 0; i < tenpercent; ++i) {
    widths.pop();
    widths.shift();
  }
  //calculate average width
  avg_width = 0;
  for (i = 0; i < widths.length; ++i) {
    avg_width += widths[i];
  }
  avg_width /= widths.length;
  // calculate the target width
  target_width = width * this.scale * 2;
  // calculate scales
  for (i = 0; i < alphabet.get_size_core(); ++i) {
    sym = alphabet.get_symbol(i);
    size = sizes[i];
    // calculate scale
    scale = target_width / Math.max(avg_width, size.width);
    // estimate scaled height
    target_height = size.height * scale;
    // create an appropriately sized canvas
    canvas = document.createElement("canvas");
    canvas.width = target_width;
    canvas.height = target_height + safety_pad * 2;
    // calculate the middle
    middle = Math.round(canvas.width / 2);
    // calculate the baseline
    baseline = Math.round(canvas.height - safety_pad);
    // get the context and prepare to draw the rasterized text
    ctx = canvas.getContext('2d');
    ctx.font = font;
    ctx.fillStyle = alphabet.get_colour(i);
    ctx.textAlign = "center";
    ctx.translate(middle, baseline);
    ctx.save();
    ctx.scale(scale, scale);
    // draw the text
    ctx.fillText(sym, 0, 0);
    ctx.restore();
    this.sym_cache[sym] = {"image": canvas, "size": canvas_bounds(ctx, canvas.width, canvas.height)};
  }
};

RasterizedAlphabet.prototype.get_alphabet = function() {
  return this.alphabet;
};

RasterizedAlphabet.prototype.get_scale = function() {
  return this.scale;
};

RasterizedAlphabet.prototype.draw_stack_sym = function(ctx, letter, dx, dy, dWidth, dHeight) {
  "use strict";
  var entry, image, size;
  entry = this.sym_cache[letter];
  image = entry.image;
  size = entry.size;
  ctx.drawImage(image, 0, size.bound_top -1, image.width, size.height+1, dx, dy, dWidth, dHeight);
};

RasterizedAlphabet.prototype.draw_stack_num = function(ctx, font, stack_width, index) {
  var image, image_ctx, text_length;
  if (index >= this.stack_num_cache.length) {
    image = document.createElement("canvas");
    // measure the text
    image_ctx = image.getContext('2d');
    image_ctx.save();
    image_ctx.font = font;
    text_length = image_ctx.measureText("" + (index + 1)).width;
    image_ctx.restore();
    // resize the canvas to fit
    image.width = Math.ceil(stack_width);
    image.height = Math.ceil(text_length);
    // draw the text
    image_ctx = image.getContext('2d');
    image_ctx.translate(Math.round(stack_width / 2), 0);
    image_ctx.font = font;
    image_ctx.textBaseline = "middle";
    image_ctx.textAlign = "right";
    image_ctx.rotate(-(Math.PI / 2));
    image_ctx.fillText("" + (index + 1), 0, 0);
    this.stack_num_cache[index] = image;
  } else {
    image = this.stack_num_cache[index];
  }
  ctx.drawImage(image, 0, 0);
}

RasterizedAlphabet.prototype.draw_scale_num = function(ctx, font, num) {
  var image, image_ctx, text_size, m_length;
  if (num >= this.scale_num_cache.length) {
    image = document.createElement("canvas");
    // measure the text
    image_ctx = image.getContext('2d');
    image_ctx.font = font;
    text_size = image_ctx.measureText("" + num);
    if (text_size.actualBoundingBoxAscent && text_size.actualBoundingBoxDesent) {
      // resize the canvas to fit
      image.width = Math.ceil(text_size.width);
      image.height = Math.ceil(text_size.actualBoundingBoxAscent + text_size.actualBoundingBoxDesent);
      // draw the text
      image_ctx = image.getContext('2d');
      image_ctx.font = font;
      image_ctx.textAlign = "right";
      image_ctx.fillText("" + num, image.width, text_size.actualBoundingBoxAscent);
    } else {
      // measure width of 'm' to approximate height, we double it later anyway
      m_length = image_ctx.measureText("m").width;
      // resize the canvas to fit
      image.width = Math.ceil(text_size.width);
      image.height = Math.ceil(2 * m_length);
      // draw the text
      image_ctx = image.getContext('2d');
      image_ctx.font = font;
      image_ctx.textAlign = "right";
      image_ctx.textBaseline = "middle";
      image_ctx.fillText("" + num, image.width, m_length);
    }
    this.scale_num_cache[num] = image;
  } else {
    image = this.scale_num_cache[num];
  }
  ctx.drawImage(image, -image.width, -Math.round(image.height / 2))
}

//======================================================================
// end RasterizedAlphabet
//======================================================================

//======================================================================
// start LogoMetrics object
//======================================================================

var LogoMetrics = function(ctx, logo_columns, logo_rows, has_names, has_finetext, x_axis, y_axis) {
  "use strict";
  var i, row_height;
  //variable prototypes
  this.pad_top = (has_names ? 5 : 0);
  this.pad_left = (y_axis ? 10 : 0);
  this.pad_right = (has_finetext ? 15 : 0);
  this.pad_bottom = 0;
  this.pad_middle = 20;
  this.name_height = 14;
  this.name_font = "bold " + this.name_height + "px Times, sans-serif";
  this.name_spacer = 0;
  this.y_axis = y_axis;
  this.y_label = "bits";
  this.y_label_height = 12;
  this.y_label_font = "bold " + this.y_label_height + "px Helvetica, sans-serif";
  this.y_label_spacer = 3;
  this.y_num_height = 12;
  this.y_num_width = 0;
  this.y_num_font = "bold " + this.y_num_height + "px Helvetica, sans-serif";
  this.y_tic_width = 5;
  this.stack_pad_left = 0;
  this.stack_font = "bold 25px Helvetica, sans-serif";
  this.stack_height = 90;
  this.stack_width = 26;
  this.stacks_pad_right = 5;
  this.x_axis = x_axis;
  this.x_num_above = 2;
  this.x_num_height = 12;
  this.x_num_width = 0;
  this.x_num_font = "bold " + this.x_num_height + "px Helvetica, sans-serif";
  this.fine_txt_height = 6;
  this.fine_txt_above = 2;
  this.fine_txt_font = "normal " + this.fine_txt_height + "px Helvetica, sans-serif";
  this.letter_metrics = new Array();
  this.summed_width = 0;
  this.summed_height = 0;
  //calculate the width of the y axis numbers
  ctx.font = this.y_num_font;
  for (i = 0; i <= 2; i++) {
    this.y_num_width = Math.max(this.y_num_width, ctx.measureText("" + i).width);
  }
  //calculate the width of the x axis numbers (but they are rotated so it becomes height)
  if (x_axis == 1) {
    ctx.font = this.x_num_font;
    for (i = 1; i <= logo_columns; i++) {
      this.x_num_width = Math.max(this.x_num_width, ctx.measureText("" + i).width);
    }
  } else if (x_axis == 0) {
    this.x_num_height = 4;
    this.x_num_width = 4;
  } else {
    this.x_num_height = 0;
    this.x_num_width = 0;
  }
  
  //calculate how much vertical space we want to draw this
  //first we add the padding at the top and bottom since that's always there
  this.summed_height += this.pad_top + this.pad_bottom;
  //all except the last row have the same amount of space allocated to them
  if (logo_rows > 1) {
    row_height = this.stack_height + this.pad_middle;
    if (has_names) {
      row_height += this.name_height;
      //the label is allowed to overlap into the spacer
      row_height += Math.max(this.y_num_height/2, this.name_spacer); 
      //the label is allowed to overlap the space used by the other label
      row_height += Math.max(this.y_num_height/2, this.x_num_height + this.x_num_above); 
    } else {
      row_height += this.y_num_height/2; 
      //the label is allowed to overlap the space used by the other label
      row_height += Math.max(this.y_num_height/2, this.x_num_height + this.x_num_above); 
    }
    this.summed_height += row_height * (logo_rows - 1);
  }
  //the last row has the name and fine text below it but no padding
  this.summed_height += this.stack_height + (this.y_axis ? this.y_num_height/2 : 0);

  var fine_txt_total = (has_finetext ? this.fine_txt_height + this.fine_txt_above : 0);
  if (has_names) {
    this.summed_height += fine_txt_total + this.name_height;
    this.summed_height += Math.max((this.y_axis ? this.y_num_height/2 : 0), 
        this.x_num_height + this.x_num_above + this.name_spacer);
  } else {
    this.summed_height += Math.max((this.y_axis ? this.y_num_height/2 : 0), 
        this.x_num_height + this.x_num_above + fine_txt_total);
  }

  //calculate how much horizontal space we want to draw this
  //first add the padding at the left and right since that's always there
  this.summed_width += this.pad_left + this.pad_right;
  if (this.y_axis) {
    //add on the space for the y-axis label
    this.summed_width += this.y_label_height + this.y_label_spacer;
    //add on the space for the y-axis
    this.summed_width += this.y_num_width + this.y_tic_width;
  }
  //add on the space for the stacks
  this.summed_width += (this.stack_pad_left + this.stack_width) * logo_columns;
  //add on the padding after the stacks (an offset from the fine text)
  this.summed_width += this.stacks_pad_right;

};

//======================================================================
// end LogoMetrics object
//======================================================================

//found this trick at http://talideon.com/weblog/2005/02/detecting-broken-images-js.cfm
function image_ok(img) {
  "use strict";
  // During the onload event, IE correctly identifies any images that
  // weren't downloaded as not complete. Others should too. Gecko-based
  // browsers act like NS4 in that they report this incorrectly.
  if (!img.complete) {
    return false;
  }
  // However, they do have two very useful properties: naturalWidth and
  // naturalHeight. These give the true size of the image. If it failed
  // to load, either of these should be zero.
  if (typeof img.naturalWidth !== "undefined" && img.naturalWidth === 0) {
    return false;
  }
  // No other way of checking: assume it's ok.
  return true;
}
  
function supports_text(ctx) {
  "use strict";
  if (!ctx.fillText) {
    return false;
  }
  if (!ctx.measureText) {
    return false;
  }
  return true;
}

//draws the scale, returns the width
function draw_scale(ctx, metrics, alphabet_ic, raster) {
  "use strict";
  var tic_height, i;
  tic_height = metrics.stack_height / alphabet_ic;
  ctx.save();
  ctx.translate(metrics.y_label_height, metrics.y_num_height/2);
  //draw the axis label
  ctx.save();
  ctx.font = metrics.y_label_font;
  ctx.translate(0, metrics.stack_height/2);
  ctx.rotate(-(Math.PI / 2));
  ctx.textAlign = "center";
  ctx.fillText("bits", 0, 0);
  ctx.restore();

  ctx.translate(metrics.y_label_spacer + metrics.y_num_width, 0);

  //draw the axis tics
  ctx.save();
  ctx.translate(0, metrics.stack_height);
  for (i = 0; i <= alphabet_ic; i++) {
    //draw the number
    ctx.save();
    ctx.translate(-1, 0);
    raster.draw_scale_num(ctx, metrics.y_num_font, i);
    ctx.restore();
    //draw the tic
    ctx.fillRect(0, -1, metrics.y_tic_width, 2);
    //prepare for next tic
    ctx.translate(0, -tic_height);
  }
  ctx.restore();

  ctx.fillRect(metrics.y_tic_width - 2, 0, 2, metrics.stack_height)

  ctx.restore();
}

function draw_stack_num(ctx, metrics, row_index, raster) {
  "use strict";
  ctx.save();
  ctx.translate(0, Math.round(metrics.stack_height + metrics.x_num_above));
  if (metrics.x_axis == 1) {
    raster.draw_stack_num(ctx, metrics.x_num_font, metrics.stack_width, row_index);
  } else if (metrics.x_axis == 0) {
    // draw dots instead of the numbers (good for small logos)
    ctx.beginPath();
    var radius = Math.round(metrics.x_num_height / 2);
    ctx.arc(Math.round(metrics.stack_width / 2), radius, radius, 0, 2 * Math.PI, false);
    ctx.fill();
  }
  ctx.restore();
}

function draw_stack(ctx, metrics, symbols, raster) {
  "use strict";
  var preferred_pad, sym_min, i, sym, sym_height, pad;
  preferred_pad = 0;
  sym_min = 5;

  ctx.save();//1
  ctx.translate(0, metrics.stack_height);
  for (i = 0; i < symbols.length; i++) {
    sym = symbols[i];
    sym_height = metrics.stack_height * sym.get_scale();
    
    pad = preferred_pad;
    if (sym_height - pad < sym_min) {
      pad = Math.min(pad, Math.max(0, sym_height - sym_min));
    }
    sym_height -= pad;

    //translate to the correct position
    ctx.translate(0, -(pad/2 + sym_height));

    //draw
    raster.draw_stack_sym(ctx, sym.get_symbol(), 0, 0, metrics.stack_width, sym_height);
    //translate past the padding
    ctx.translate(0, -(pad/2));
  }
  ctx.restore();//1
}

function draw_dashed_line(ctx, pattern, start, x1, y1, x2, y2) {
  "use strict";
  var x, y, len, i, dx, dy, tlen, theta, mulx, muly, lx, ly;
  dx = x2 - x1;
  dy = y2 - y1;
  tlen = Math.pow(dx*dx + dy*dy, 0.5);
  theta = Math.atan2(dy,dx);
  mulx = Math.cos(theta);
  muly = Math.sin(theta);
  lx = [];
  ly = [];
  for (i = 0; i < pattern; ++i) {
    lx.push(pattern[i] * mulx);
    ly.push(pattern[i] * muly);
  }
  i = start;
  x = x1;
  y = y1;
  len = 0;
  ctx.beginPath();
  while (len + pattern[i] < tlen) {
    ctx.moveTo(x, y);
    x += lx[i];
    y += ly[i];
    ctx.lineTo(x, y);
    len += pattern[i];
    i = (i + 1) % pattern.length;
    x += lx[i];
    y += ly[i];
    len += pattern[i];
    i = (i + 1) % pattern.length;
  }
  if (len < tlen) {
    ctx.moveTo(x, y);
    x += mulx * (tlen - len);
    y += muly * (tlen - len);
    ctx.lineTo(x, y);
  }
  ctx.stroke();
}

function draw_trim_background(ctx, metrics, left_start, left_end, left_divider, right_start, right_end, right_divider) {
  "use strict";
  var left_size = left_end - left_start;
  var right_size = right_end - right_start;
  var line_x;

  ctx.save();//s8
  ctx.fillStyle = "rgb(240, 240, 240)";
  if (left_size > 0) {
    ctx.fillRect(left_start * metrics.stack_width, 0, left_size * metrics.stack_width, metrics.stack_height);
  }
  if (right_size > 0) {
    ctx.fillRect(right_start * metrics.stack_width, 0, right_size * metrics.stack_width, metrics.stack_height);
  }
  ctx.fillStyle = "rgb(51, 51, 51)";
  if (left_size > 0 && left_divider) {
    line_x = (left_end * metrics.stack_width) - 0.5;
    draw_dashed_line(ctx, [3], 0, line_x, 0, line_x, metrics.stack_height);
  }
  if (right_size > 0 && right_divider) {
    line_x = (right_start * metrics.stack_width) + 0.5;
    draw_dashed_line(ctx, [3], 0, line_x, 0, line_x, metrics.stack_height);
  }
  ctx.restore();//s8
}

function size_logo_on_canvas(logo, canvas, show_names, scale) {
  "use strict";
  var draw_name, draw_finetext, metrics;
  draw_name = (typeof show_names === "boolean" ? show_names : (logo.get_rows() > 1));
  draw_finetext = (logo.fine_text.length > 0);
  if (canvas.width !== 0 && canvas.height !== 0) {
    return;
  }
  metrics = new LogoMetrics(canvas.getContext('2d'), 
      logo.get_xlate_columns(), logo.get_rows(), draw_name, draw_finetext, logo.x_axis, logo.y_axis);
  if (typeof scale == "number") {
    //resize the canvas to fit the scaled logo
    canvas.width = metrics.summed_width * scale;
    canvas.height = metrics.summed_height * scale;
  } else {
    if (canvas.width === 0 && canvas.height === 0) {
      canvas.width = metrics.summed_width;
      canvas.height = metrics.summed_height;
    } else if (canvas.width === 0) {
      canvas.width = metrics.summed_width * (canvas.height / metrics.summed_height);
    } else if (canvas.height === 0) {
      canvas.height = metrics.summed_height * (canvas.width / metrics.summed_width);
    }
  }
}

function draw_logo_on_canvas(logo, canvas, show_names, scale) {
  "use strict";
  var i, draw_name, draw_finetext, ctx, metrics, raster, pspm_i, pspm, 
      offset, col_index, motif_position, ssc;
  ssc = false;
  draw_name = (typeof show_names === "boolean" ? show_names : (logo.get_rows() > 1));
  draw_finetext = (logo.fine_text.length > 0);
  ctx = canvas.getContext('2d');
  //assume that the user wants the canvas scaled equally so calculate what the best width for this image should be
  metrics = new LogoMetrics(ctx, logo.get_xlate_columns(), logo.get_rows(), draw_name, draw_finetext, logo.x_axis, logo.y_axis);
  if (typeof scale == "number") {
    //resize the canvas to fit the scaled logo
    canvas.width = metrics.summed_width * scale;
    canvas.height = metrics.summed_height * scale;
  } else {
    if (canvas.width === 0 && canvas.height === 0) {
      scale = 1;
      canvas.width = metrics.summed_width;
      canvas.height = metrics.summed_height;
    } else if (canvas.width === 0) {
      scale = canvas.height / metrics.summed_height;
      canvas.width = metrics.summed_width * scale;
    } else if (canvas.height === 0) {
      scale = canvas.width / metrics.summed_width;
      canvas.height = metrics.summed_height * scale;
    } else {
      scale = Math.min(canvas.width / metrics.summed_width, canvas.height / metrics.summed_height);
    }
  }
  // cache the raster based on the assumption that we will be drawing a lot
  // of logos the same size and alphabet
  if (typeof draw_logo_on_canvas.raster_cache === "undefined") {
    draw_logo_on_canvas.raster_cache = [];
  }
  for (i = 0; i < draw_logo_on_canvas.raster_cache.length; i++) {
    raster = draw_logo_on_canvas.raster_cache[i];
    if (raster.get_alphabet().equals(logo.alphabet) &&
        Math.abs(raster.get_scale() - scale) < 0.1) break;
    raster = null;
  }
  if (raster == null) {
    raster = new RasterizedAlphabet(logo.alphabet, scale, metrics.stack_font, metrics.stack_width);
    draw_logo_on_canvas.raster_cache.push(raster);
  }
  ctx = canvas.getContext('2d');
  ctx.save();//s1
  ctx.scale(scale, scale);
  ctx.save();//s2
  ctx.save();//s7
  //create margin
  ctx.translate(Math.round(metrics.pad_left), Math.round(metrics.pad_top));
  for (pspm_i = 0; pspm_i < logo.get_rows(); ++pspm_i) {
    pspm = logo.get_pspm(pspm_i);
    offset = logo.get_offset(pspm_i);
    //optionally draw name if this isn't the last row or is the only row 
    if (draw_name && (logo.get_rows() == 1 || pspm_i != (logo.get_rows()-1))) {
      ctx.save();//s4
      ctx.translate(Math.round(metrics.summed_width/2), Math.round(metrics.name_height));
      ctx.font = metrics.name_font;
      ctx.textAlign = "center";
      ctx.fillText(pspm.name, 0, 0);
      ctx.restore();//s4
      ctx.translate(0, Math.round(metrics.name_height + 
          Math.min(0, metrics.name_spacer - metrics.y_num_height/2)));
    }
    //draw scale
    if (logo.y_axis) draw_scale(ctx, metrics, logo.alphabet.get_ic(), raster);
    ctx.save();//s5
    //translate across past the scale
    if (logo.y_axis) {
      ctx.translate(Math.round(metrics.y_label_height + metrics.y_label_spacer + 
        metrics.y_num_width + metrics.y_tic_width), Math.round(metrics.y_num_height / 2));
    }
    //draw the trimming background
    if (pspm.get_left_trim() > 0 || pspm.get_right_trim() > 0) {
      var left_start = offset * logo.get_xlate_nsyms();
      var left_end = (offset + pspm.get_left_trim()) * logo.get_xlate_nsyms();
      var left_divider = true;
      if (left_end < logo.get_xlate_start() || left_start > logo.get_xlate_end()) {
        // no overlap
        left_start = 0;
        left_end = 0;
        left_divider = false;
      } else {
        if (left_start < logo.get_xlate_start()) {
          left_start = logo.get_xlate_start();
        }
        if (left_end > logo.get_xlate_end()) {
          left_end = logo.get_xlate_end();
          left_divider = false;
        }
        left_start -= logo.get_xlate_start();
        left_end -= logo.get_xlate_start();
        if (left_end < left_start) {
          left_start = 0;
          left_end = 0;
          left_divider = false;
        }
      }
      var right_end = (offset + pspm.get_motif_length()) * logo.get_xlate_nsyms();
      //var right_start = right_end - (pspm.get_left_trim() * logo.get_xlate_nsyms());
      var right_start = right_end - (pspm.get_right_trim() * logo.get_xlate_nsyms());
      var right_divider = true;
      if (right_end < logo.get_xlate_start() || right_start > logo.get_xlate_end()) {
        // no overlap
        right_start = 0;
        right_end = 0;
        right_divider = false;
      } else {
        if (right_start < logo.get_xlate_start()) {
          right_start = logo.get_xlate_start();
          right_divider = false;
        }
        if (right_end > logo.get_xlate_end()) {
          right_end = logo.get_xlate_end();
        }
        right_start -= logo.get_xlate_start();
        right_end -= logo.get_xlate_start();
        if (right_end < right_start) {
          right_start = 0;
          right_end = 0;
          right_divider = false;
        }
      }
      draw_trim_background(ctx, metrics, left_start, left_end, left_divider, right_start, right_end, right_divider);
    }
    //draw letters
    var xlate_col;
    for (xlate_col = logo.get_xlate_start(); xlate_col < logo.get_xlate_end(); xlate_col++) {
      ctx.translate(metrics.stack_pad_left,0);
      col_index = Math.floor(xlate_col / logo.get_xlate_nsyms());
      if (xlate_col % logo.get_xlate_nsyms() == 0) {
        if (col_index >= offset && col_index < (offset + pspm.get_motif_length())) {
          motif_position = col_index - offset;
          draw_stack_num(ctx, metrics, motif_position, raster);
          draw_stack(ctx, metrics, pspm.get_stack(motif_position, logo.alphabet, ssc), raster);
        }
      } else {
        if (col_index >= offset && col_index < (offset + pspm.get_motif_length())) {
          ctx.save();// s5.1
          ctx.translate(0, Math.round(metrics.stack_height));
          // TODO draw a dot or dash or something to indicate continuity of the motif
          ctx.restore(); //s5.1
        }
      }
      ctx.translate(Math.round(metrics.stack_width), 0);
    }
    ctx.restore();//s5
    ////optionally draw name if this is the last row but isn't the only row 
    if (draw_name && (logo.get_rows() != 1 && pspm_i == (logo.get_rows()-1))) {
      //translate vertically past the stack and axis's        
      ctx.translate(0, metrics.y_num_height/2 + metrics.stack_height + 
          Math.max(metrics.y_num_height/2, metrics.x_num_above + metrics.x_num_width + metrics.name_spacer));

      ctx.save();//s6
      ctx.translate(metrics.summed_width/2, metrics.name_height);
      ctx.font = metrics.name_font;
      ctx.textAlign = "center";
      ctx.fillText(pspm.name, 0, 0);
      ctx.restore();//s6
      ctx.translate(0, metrics.name_height);
    } else {
      //translate vertically past the stack and axis's        
      ctx.translate(0, metrics.y_num_height/2 + metrics.stack_height + 
          Math.max(metrics.y_num_height/2, metrics.x_num_above + metrics.x_num_width));
    }
    //if not the last row then add middle padding
    if (pspm_i != (logo.get_rows() -1)) {
      ctx.translate(0, metrics.pad_middle);
    }
  }
  ctx.restore();//s7
  if (logo.fine_text.length > 0) {
    ctx.translate(metrics.summed_width - metrics.pad_right, metrics.summed_height - metrics.pad_bottom);
    ctx.font = metrics.fine_txt_font;
    ctx.textAlign = "right";
    ctx.fillText(logo.fine_text, 0,0);
  }
  ctx.restore();//s2
  ctx.restore();//s1
}

function create_canvas(c_width, c_height, c_id, c_title, c_display) {
  "use strict";
  var canvas = document.createElement("canvas");
  //check for canvas support before attempting anything
  if (!canvas.getContext) {
    return null;
  }
  var ctx = canvas.getContext('2d');
  //check for html5 text drawing support
  if (!supports_text(ctx)) {
    return null;
  }
  //size the canvas
  canvas.width = c_width;
  canvas.height = c_height;
  canvas.id = c_id;
  canvas.title = c_title;
  canvas.style.display = c_display;
  return canvas;
}

function logo_1(alphabet, fine_text, pspm) {
  "use strict";
  var logo = new Logo(alphabet, fine_text);
  logo.add_pspm(pspm);
  return logo;
}

function logo_2(alphabet, fine_text, target, query, query_offset) {
  "use strict";
  var logo = new Logo(alphabet, fine_text);
  if (query_offset < 0) {
    logo.add_pspm(target, -query_offset);
    logo.add_pspm(query);
  } else {
    logo.add_pspm(target);
    logo.add_pspm(query, query_offset);
  }      
  return logo;
}

/*
 * Specifies an alternate source for an image.
 * If the image with the image_id specified has
 * not loaded then a generated logo will be used 
 * to replace it.
 *
 * Note that the image must either have dimensions
 * or a scale must be set.
 */
function alternate_logo(logo, image_id, scale) {
  "use strict";
  var image = document.getElementById(image_id);
  if (!image) {
    alert("Can't find specified image id (" +  image_id + ")");
    return;
  }
  //if the image has loaded then there is no reason to use the canvas
  if (image_ok(image)) {
    return;
  }
  //the image has failed to load so replace it with a canvas if we can.
  var canvas = create_canvas(image.width, image.height, image_id, image.title, image.style.display);
  if (canvas === null) {
    return;
  }
  //draw the logo on the canvas
  draw_logo_on_canvas(logo, canvas, null, scale);
  //replace the image with the canvas
  image.parentNode.replaceChild(canvas, image);
}

/*
 * Specifies that the element with the specified id
 * should be replaced with a generated logo.
 */
function replace_logo(logo, replace_id, scale, title_txt, display_style) {
  "use strict";
  var element = document.getElementById(replace_id);
  if (!replace_id) {
    alert("Can't find specified id (" + replace_id + ")");
    return;
  }
  //found the element!
  var canvas = create_canvas(50, 120, replace_id, title_txt, display_style);
  if (canvas === null) {
    return;
  }
  //draw the logo on the canvas
  draw_logo_on_canvas(logo, canvas, null, scale);
  //replace the element with the canvas
  element.parentNode.replaceChild(canvas, element);
}

/*
 * Fast string trimming implementation found at
 * http://blog.stevenlevithan.com/archives/faster-trim-javascript
 *
 * Note that regex is good at removing leading space but
 * bad at removing trailing space as it has to first go through
 * the whole string.
 */
function trim (str) {
  "use strict";
  var ws, i;
  str = str.replace(/^\s\s*/, '');
  ws = /\s/; i = str.length;
  while (ws.test(str.charAt(--i)));
  return str.slice(0, i + 1);
}

    </script>
    <script type="text/javascript">
//
// simple-shared-doc.js
//
// Function to replace the innerHTML of element "id" with the HTML indicated by "doc_type".
// Easier to read and update than the more flexible approach in shared-doc.js. 
//
function print_doc(id, doc_type) {
  var html;
  switch (doc_type) {
    case 'motif-consensus':
      html = `
	<p id="consensus_doc"> 
	   A <b>consensus sequence</b> is constructed from each column in a
	   motif's frequency matrix using the <b>"50% rule"</b>
	   as follows:
	</p>
	<ol>
	  <li>The letter frequencies in the column are sorted in decreasing order.</li>
	  <li>Letters with frequency less 50% of the maximum are discarded.</li>
	  <li>The letter used in this position in the consensus sequence is determined
	  by the first rule below that applies:</li>
	  <ul>
	    <li>If there is only one letter left, or if the remaining letters exactly match
	    an ambiguous symbol in the alphabet, the <b>letter</b> or <b>ambiguous symbol</b>,
	    respectively, is used.</li>
	    <li>Otherwise, if the remaining set contains at least 50% of the core
	    symbols in the alphabet, the alphabet's <b>wildcard</b>
	    (e.g., "N" for DNA or RNA, and "X" for protein) is used.</li>
	    <li>Otherwise, the letter with the <b>maximum frequency</b> is used.</li>
	  </ul>
	</ol>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'ame-results-header':
      html = `
	<p>
          AME outputs a tab-separated values (TSV) file ('ame.tsv') that contains one line for each motif
	  found to be significantly enriched.
	  The lines are sorted in order of decreasing statistical significance.
          The first line contains the (tab-separated) names of the fields.
	  Your command line is given at the end of the file in a comment line starting with the
	  character '#'.
	</p>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'ame-results-table':
      html = `
	<p>
	  The <a href="` + site_url + `/doc/ame-output-format.html#tsv_results">AME Results TSV Format</a> 
	  differs depending on the choice of method for measuring motif enrichment, as shown in the following table. 
	</p>
	<table style="width:100%" border=1>
	  <tr>
	    <th>Method</th>
	    <th colspan=19>Output Columns</th>
	  </tr>
	  <tr>
	    <th></th> 
	    <th>1</th>
	    <th>2</th>
	    <th>3</th>
	    <th>4</th>
	    <th>5</th>
	    <th>6</th>
	    <th>7</th>
	    <th>8</th>
	    <th>9</th>
	    <th>10</th>
	    <th>11</th>
	    <th>12</th>
	    <th>13 </th>
	    <th>14 </th>
	    <th>15 </th>
	    <th>16 </th>
	    <th>17 </th>
	    <th>18 </th>
	    <th>19 </th>
	  </tr>
	  <tr>
	    <td>fisher</td>
	    <td>rank </td>
	    <td>motif_DB </td>
	    <td>motif_ID </td>
	    <td>motif_alt_ID </td>
	    <td>consensus </td>
	    <td>p-value </td>
	    <td>adj_p-value </td>
	    <td>E-value</td>
	    <td>tests </td>
	    <td>FASTA_max </td>
	    <td>pos </td>
	    <td>neg </td>
	    <td>PWM_min</td>
	    <td>TP </td>
	    <td>%TP </td>
	    <td>FP </td>
	    <td>%FP </td>
	    </td> <td>
	    </td> <td>
	  </tr>
	  <tr>
	    <td>ranksum</td>
	    <td>rank </td>
	    <td>motif_DB </td>
	    <td>motif_ID </td>
	    <td>motif_alt_ID </td>
	    <td>consensus </td>
	    <td>p-value </td>
	    <td>adj_p-value </td>
	    <td>E-value</td>
	    <td>tests </td>
	    <td>FASTA_max </td>
	    <td>pos </td>
	    <td>neg</td>
	    <td>U </td>
	    <td>pleft </td>
	    <td>pright </td>
	    <td>pboth </td>
	    <td>adj_pleft </td>
	    <td>adj_pright </td>
	    <td>adj_both</td>
	  </tr>
	  <tr>
	    <td>3dmhg</td>
	    <td>rank </td>
	    <td>motif_DB </td>
	    <td>motif_ID </td>
	    <td>motif_alt_ID </td>
	    <td>consensus </td>
	    <td>p-value </td>
	    <td>adj_p-value </td>
	    <td>E-value</td>
	    <td>tests </td>
	    <td>FASTA_max </td>
	    <td>pos </td>
	    <td>neg</td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	  </tr>
	  <tr>
	    <td>4dmhg</td>
	    <td>rank </td>
	    <td>motif_DB </td>
	    <td>motif_ID </td>
	    <td>motif_alt_ID </td>
	    <td>consensus </td>
	    <td>p-value </td>
	    <td>adj_p-value </td>
	    <td>E-value</td>
	    <td>tests </td>
	    <td>FASTA_max </td>
	    <td>pos </td>
	    <td>neg</td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	  </tr>
	  <tr>
	    <td>pearson</td>
	    <td>rank </td>
	    <td>motif_DB </td>
	    <td>motif_ID </td>
	    <td>motif_alt_ID </td>
	    <td>consensus </td>
	    <td>p-value </td>
	    <td>adj_p-value </td>
	    <td>E-value</td>
	    <td>tests </td>
	    <td>Pearson_CC </td>
	    <td>mean_squared_error </td>
	    <td>slope </td>
	    <td>intercept</td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	  </tr>
	  <tr>
	    <td>spearman</td>
	    <td>rank </td>
	    <td>motif_DB </td>
	    <td>motif_ID </td>
	    <td>motif_alt_ID </td>
	    <td>consensus </td>
	    <td>p-value </td>
	    <td>adj_p-value </td>
	    <td>E-value</td>
	    <td>tests </td>
	    <td>Spearman_CC</td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	  </tr>
        </table>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'ame-results-description':
      html = `
        <p>
          The names and meanings of each of the fields in <a href="` + site_url + `/doc/ame-output-format.html#tsv_results">AME Results TSV Format</a>,
          which depend on the method of enrichment analysis you chose, are described below.
        </p>
        <table class="dark" style="width:100%" border=1>
	  <tr> <th>method</th> <th>field</th> <th>name</th> <th>contents</th> </tr>	
    	  <tr> <td>all</td> <td>1</td> <td>rank</td> <td>The rank of the significance of the motif in the sorted results.</td> </tr>
    	  <tr> <td>all</td> <td>2</td> <td>motif_DB</td> <td> ` + get_doc_text('motif-db', 'the motif.') + `</td> </tr>
    	  <tr> <td>all</td> <td>3</td> <td>motif_ID</td> <td> ` + get_doc_text('motif-id') + `</td> </tr>
    	  <tr> <td>all</td> <td>4</td> <td>motif_alt_ID</td> <td> ` + get_doc_text('motif-alt-id') + `</td> </tr>
    	  <tr> <td>all</td> <td>5</td> <td>consensus</td> <td> ` + get_doc_text('motif-cons') + `</td> </tr>
    	  <tr> <td>all</td> <td>6</td> <td>p-value</td> <td> ` + get_doc_text('ame-pvalue') + `</td> </tr>
    	  <tr> <td>all</td> <td>7</td> <td>adj_p-value</td> <td> ` + get_doc_text('ame-adj-pvalue') + `</td> </tr>
    	  <tr> <td>all</td> <td>8</td> <td>E-value</td> <td> ` + get_doc_text('ame-evalue') + `</td> </tr>
    	  <tr> <td>all</td> <td>9</td> <td>tests</td> <td>The number of tests performed; used in correcting the <i>p</i>-value</td> </tr>
	  <tr> <td colspan=4></td>
          <tr> <td>fisher, ranksum, 3dmhg, 4dmhg</td> <td>10</td> <td>FASTA_max</td> <td>The optimal threshold for <b>labeling</b> sequences as positive;
            sequences with FASTA score less than or equal to the threshold are labeled as positive;
            this field will be contain the number of primary sequences if you provided
            a control file (using option <code>--control</code>); this field will contain the size of the
            partition if you specified one (using option <code>--fix-partition</code>).</td> </tr>
          <tr> <td>fisher, ranksum, 3dmhg, 4dmhg</td> <td>11</td> <td>pos</td> <td>The number of sequences <b>labeled</b> as positive.</td> </tr>
          <tr> <td>fisher, ranksum, 3dmhg, 4dmhg</td> <td>12</td> <td>neg</td> <td>The number of sequences <b>labeled</b> as negative.</td> </tr>
	  <tr> <td colspan=4></td>
          <tr> <td>fisher</td> <td>13</td> <td>PWM_min</td> <td>The optimal threshold on PWM score for <b>classifying</b> sequences as positive;
                sequences with PWM score greater than or equal to the threshold are classified as positive.</td> </tr>
          <tr> <td>fisher</td> <td>14</td> <td>TP</td> <td>The number of true positive sequences: sequences both <b>labeled</b> and <b>classified</b> as positive</td> </tr>
          <tr> <td>fisher</td> <td>15</td> <td>%TP</td> <td>The percentage of true positive sequences: percentage of sequences <b>labeled</b> positive and <b>classified</b> as positive.</td> </tr>
          <tr> <td>fisher</td> <td>16</td> <td>FP</td> <td>The number of false positive sequences: sequences <b>labeled</b> negative but <b>classified</b> as positive.</td> </tr>
          <tr> <td>fisher</td> <td>17</td> <td>%TP</td> <td>The percentage of false positive sequences: sequences <b>labeled</b> negative but <b>classified</b> as positive.</td> </tr>
	  <tr> <td colspan=4></td>
          <tr> <td>ranksum</td> <td>13</td> <td>U</td> <td>The value of the Mann-Whitney <i>U</i> statistic.</td> </tr>
          <tr> <td>ranksum</td> <td>14</td> <td>pleft</td> <td>The left-tailed <i>p</i>-value of the rank-sum test.</td> </tr>
          <tr> <td>ranksum</td> <td>15</td> <td>pright</td> <td>The right-tailed <i>p</i>-value of the rank-sum test.</td> </tr>
          <tr> <td>ranksum</td> <td>16</td> <td>pboth</td> <td>The two-tailed <i>p</i>-value of the rank-sum test.</td> </tr>
          <tr> <td>ranksum</td> <td>17</td> <td>adj_pleft</td> <td>The left-tailed <i>p</i>-value of the rank-sum test, adjusted for multiple tests.</td> </tr>
          <tr> <td>ranksum</td> <td>18</td> <td>adj_pright</td> <td>The right-tailed <i>p</i>-value of the rank-sum test, adjusted for multiple tests.</td> </tr>
          <tr> <td>ranksum</td> <td>19</td> <td>adj_both</td> <td>The two-tailed <i>p</i>-value of the rank-sum test, adjusted for multiple tests.</td> </tr>
	  <tr> <td colspan=4></td>
	  <tr> <td>pearson</td> <td>10</td> <td>Pearson_CC</td> <td>The correlation coefficient of the PWM and FASTA scores of positive sequences.</td> </tr>
	  <tr> <td>pearson</td> <td>11</td> <td>mean_squared_error</td> <td>The mean-squared error of the regression line between PWM and FASTA scores.</td> </tr>
	  <tr> <td>pearson</td> <td>12</td> <td>slope</td> <td>The slope of the regression line.</td> </tr>
	  <tr> <td>pearson</td> <td>13</td> <td>intercept</td> <td>The y-intercept of the regression line.</td> </tr>
	  <tr> <td colspan=4></td>
	  <tr> <td>spearman</td> <td>10</td> <td>Spearman_CC</td> <td>The correlation coefficient of the PWM and FASTA ranks of positive sequences./td> </tr>
        </table>
	  </ul>
	</p>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'ame-sequences-tsv':
      html = `
        <p>AME outputs a tab-separated values (TSV) file ('sequences.tsv') containing one line for
	each sequence classified as 'positive' by AME for each significant motif.
        The first line contains the (tab-separated) names of the fields.
	The lines are grouped by motif, and groups are separated by a line
	starting with the character "#".
        </p>
        <p>
          The names and meanings of each of the fields in <a href="` + site_url + `/doc/ame-output-format.html#tsv_sequences">AME Significant Sequences TSV Format</a>,
          are described below.
        </p>
        <table class="dark" style="width:100%" border=1>
          <tr> <th>field</th> <th>name</th> <th>contents</th> </tr>
	  <tr> <td>1</td> <td>motif_DB</td> <td>` + get_doc_text('motif-db', 'the motif.') + `</td> </tr>
	  <tr> <td>2</td> <td>motif_ID</td> <td>the ID of the motif</td> </tr>
	  <tr> <td>3</td> <td>seq_ID</td> <td>the ID of the sequence</td> </tr>
	  <tr> <td>4</td> <td><i>label_score</i> (either FASTA_score or PWM_score)</td> <td>the value of the score used to label it as positive</td> </tr>
	  <tr> <td>5</td> <td><i>class_score</i> (either PWM_score or FASTA_score)</td> <td>the value of the score used to classify it as positive</td> </tr>
	  <tr> <td>6</td> <td>class</td> <td>whether the sequence is a true positive, 'tp', or a false positive, 'fp'</td> </tr>
        </table>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'centrimo-results-tsv':
      html = `
	<p>
          CentriMo outputs a tab-separated values (TSV) file ('centrimo.tsv') that contains one line for each 
	  region found to be significantly enriched for a motif.
	  The lines are sorted in order of decreasing statistical significance.
          The first line contains the (tab-separated) names of the fields.
          Your command line is given at the end of the file in a comment line starting with the
          character '#'.
	</p>
	<p>
          The names and meanings of each of the fields in <a href="` + site_url + `/doc/centrimo-output-format.html#tsv_results">CentriMo Results TSV Format</a>,
          which depend on whether or not you provide control sequences to CentriMo, are described below.
	</p>
        <table class="dark" style="width:100%" border=1>
          <tr> <th>field</th> <th>name</th> <th>contents</th> </tr>
	  <tr> <td>1</td> <td>db_index</td> <td>The index of the motif file that contains the motif.  Motif
	      files are numbered in the order the appeared in the command line.</td> </tr>
	  <tr> <td>2</td> <td>motif_id</td> <td> ` + get_doc_text('motif-id') + `
	      If more than one motif has the same ID, CentriMo uses only the first such motif.
	      The name is single-quoted and preceded with '+' or '-' if you scanned separately with 
	      the reverse complement motif (using the <code>--sep</code> option).</td> </tr>
	  <tr> <td>3</td> <td>motif_alt_id</td> <td> ` + get_doc_text('motif-alt-id') + `</td> </tr>
	  <tr> <td>4</td> <td>consensus</td> <td> ` + get_doc_text('motif-cons') + `</td> </tr>
	  <tr> <td>5</td> <td>E-value</td> <td> ` + get_doc_text('centrimo-evalue') + `</td> </tr>
	  <tr> <td>6</td> <td>adj_p-value</td> <td> ` + get_doc_text('centrimo-adj-pvalue') + `
	      By default, a <i>p</i>-value is calculated by using the one-tailed binomial
	      test on the number of sequences with a match to the motif
	      that have their best match in the reported region;
              if you provided control sequences, the <i>p</i>-value of Fisher\'s exact test on the enrichment of 
              best matches in the positive sequences relative to the negative sequences is computed instead;
	      if you used the <code>--cd</code> option, the <i>p</i>-value is the probability that the average 
	      distance between the best site and the sequence center would be as low or lower than observed, 
	      computed using the cumulative Bates distribution, optimized over different score thresholds.
	      In all cases, the reported <i>p</i>-value has been adjusted for the number of regions
	      and/or score thresholds tested.</td> </tr>
	  <tr> <td>7</td> <td>log_adj_p-value</td> <td>Log of adjusted <i>p</i>-value.</td> </tr>
	  <tr> <td>8</td> <td>bin_location</td> <td>Location of the center of the most enriched region, or
		0 if you used the <code>--cd</code> option.
	  <tr> <td>9</td> <td>bin_width</td> <td> ` + get_doc_text('centrimo-bin-width') + `</td> </tr>
	  <tr> <td>10</td> <td>total_width</td> <td>The maximum number of regions possible for this motif
              <br>&nbsp;&nbsp;
	      round(sequence_length - motif_length + 1)/2,<br>
	      or the number of places the motif will fit if you used the <code>--cd</code> option.</td> </tr>
	  <tr> <td>11</td> <td>sites_in_bin</td> <td> ` + get_doc_text('centrimo-sites-in-bin') + `</td> </tr>
	  <tr> <td>12</td> <td>total_sites</td> <td>The number of sequences containing a match to the motif
	      above the score threshold.
	  <tr> <td>13</td> <td>p_success</td> <td>The probability of a random match falling into the enriched region:
	      <br>&nbsp;&nbsp;
	      bin_width / total_width</td> </tr>
	  <tr> <td>14</td> <td>p-value</td> <td>The uncorrected <i>p</i>-value before it gets adjusted for the
	      number of multiple tests to give the adjusted <i>p</i>-value.</td> </tr>
	  <tr> <td>15</td> <td>mult_tests</td> <td> ` + get_doc_text('centrimo-mult-tests') + `</td> </tr>
	  <tr> <th colspan=3>The following additional columns are present when you provide control sequences to CentriMo
	  (using the <code>--neg</code> option).</th> </tr>
	  <tr> <td>16</td> <td>neg_sites_in_bin</td> <td>The number of negative sequences where the best
	      match to the motif falls in the reported region.
	      This value is rounded but the underlying value may contain fractional counts.
	      Note: This number may be less than the number of negative have a best match in the region.
	      The reason for this is that a sequence may have many matches that score equally best.
	      If n matches have the best score in a sequence, 1/n is added to the
	      appropriate bin for each match.</td> </tr>
	  <tr> <td>17</td> <td>neg_sites</td> <td>The number of negative sequences containing a match to the
	      motif above the minimum score threshold.
	      When score optimization is enabled the score threshold may be raised
	      higher than the minimum.</td> </tr>
	  <tr> <td>18</td> <td>neg_adj_pvalue</td> <td>The probability that any tested region in the negative
	      sequences would be as enriched for best matches to this motif
	      according to the Binomial test.</td> </tr>
	  <tr> <td>19</td> <td>log_neg_adj_pvalue</td> <td>Log of negative adjusted <i>p</i>-value.</td> </tr>
	  <tr> <td>20</td> <td>fisher_adj_pvalue</td> <td>Fisher adjusted <i>p</i>-value before it gets adjusted for the
	      number of motifs in the input files(s).</td> </tr>
	  <tr> <td>21</td> <td>log_fisher_adj_pvalue</td> <td>Log of Fisher adjusted <i>p</i>-value.</td> </tr>
        </table>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'centrimo-sites-txt':
      html = `
	<p>
          CentriMo outputs a text file ('site_counts.txt') that contains,
	  for each motif, pairs of values (bin_position, site_count),
	  or triples of values (bin_position, site_count, neg_site_count) if
	  you provided control sequences to CentriMo.
	  This data can be used to plot the density of motif best matches (sites)
	  along the input sequences.  Fractional counts are possible if multiple (n)
	  bins contain the best match for a given sequence, with each bin  
	  receiving an incremental count of 1/n. 
	</p>
	<p>
	  The data for each motif begins with a header line with the format:
	  <br>&nbsp&nbsp
		DB &lt;db_number&gt; MOTIF &lt;id&gt; &lt;alt&gt;
	  </br>
	  where &lt;id&gt; and &lt;alt&gt; are as described above.
	  The following lines (up to the next header line) 
	  each contain a single value-pair or value-triple for the motif
	  named in the header line.
	</p>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'meme-chip-results-tsv':
      html = `
	<p>
          MEME-ChIP outputs a tab-separated values (TSV) file ('summary.tsv') that 
	  contains one line for each motif found by MEME-ChIP.
	  The lines are sorted in order of decreasing statistical significance.
	  The first line contains the (tab-separated) names of the fields.
	  Your command line is given at the end of the file in a comment line starting with the
	  character '#'.
	</p>
	<p>
          The names and meanings of the fields in the 
	  <a href="` + site_url + `/doc/meme-chip-output-format.html">MEME-ChIP Results Summary TSV Format</a> 
	  are described below. 
	</p>
        <table class="dark" style="width:100%" border=1>
          <tr> <th>field</th> <th>name</th> <th>contents</th> </tr>
          <tr> <td>1</td> <td>MOTIF_INDEX</td> <td>The index of the motif in the "Motifs in MEME text format" file ('combined.meme') 
		output by MEME-ChIP.</td> </tr>
          <tr> <td>2</td> <td>MOTIF_SOURCE</td> <td>The name of the program that found the <i>de novo</i> motif, or the
                name of the motif file containing the known motif.</td> </tr>
          <tr> <td>3</td> <td>MOTIF_ID</td> <td> ` + get_doc_text('motif-id') + `</td> </tr>
          <tr> <td>4</td> <td>ALT_ID</td> <td> ` + get_doc_text('motif-alt-id') + `</td> </tr>
          <tr> <td>5</td> <td>CONSENSUS</td> <td>The ID of the <i>de novo</i> motif, or a consensus sequence
                computed from the letter frequencies in the known motif
                (as described <a href="#consensus_doc">below</a>).</td> </tr>
          <tr> <td>6</td> <td>WIDTH</td> <td>The width of the motif.</td> </tr>
          <tr> <td>7</td> <td>SITES</td> <td>The number of sites reported by the <i>de novo</i> program, or the number
                of "Total Matches" reported by CentriMo.</td> </tr>
          <tr> <td>8</td> <td>E-VALUE</td> <td>The statistical significance of the motif.</td> </tr>
          <tr> <td>9</td> <td>E-VALUE_SOURCE</td> <td>The program that reported the <i>E</i>-value.</td> </tr>
          <tr> <td>10</td> <td>MOST_SIMILAR_MOTIF</td> <td>The known motif most similar to this motif according to Tomtom.</td> </tr>
          <tr> <td>11</td> <td>URL</td> <td>A link to a description of the most similar motif, or to the known motif.</td> </tr>
        </table>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'meme-chip-combined-motifs':
      html = `
        <p>
          MEME-ChIP outputs a text file ('combined.meme') containing all the significant motifs found by MEME-ChIP.
          The motifs are in <a href="` + site_url + `/doc/meme-format.html">Minimal MEME Motif format</a>, 
	  and their IDs correspond to the motif indices given in the "Summary in TSV Format" file ('summary.tsv').
        </p>
        </p>
          <b>Note:</b> The 'nsites=' and 'E=' fields in the motif headers are only
          relevant for the MEME and DREME motifs.  For known motifs, those values do
          not refer to the number of sites in the input sequences.
        </p>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'spamo-results-tsv':
      html = `
	<p>
          SpaMo outputs a tab-separated values (TSV) file ('spamo.tsv') that contains one line for each motif
	  found to be significantly enriched.
	  The lines are grouped by secondary motif and sorted in order of decreasing statistical significance.
          The first line contains the (tab-separated) names of the fields.
	  Your command line is given at the end of the file in a comment line starting with the character '#'.
	</p>
	<p>
	  The names and meanings of each of the fields in <a href="` + site_url + `/doc/spamo-output-format.html#results-tsv">SpaMo Results TSV Format</a> 
	  are described below. 
	</p>
	<table class="dark" style="width:100%" border=1>
	  <tr> <th>field</th> <th>name</th> <th>contents</th> </tr>
          <tr> <td>1</td> <td>prim_db</td> <td> ` + get_doc_text('motif-db', 'the primary motif.') + `</td> </tr>
          <tr> <td>2</td> <td>prim_id</td> <td> ` + get_doc_text('motif-id', 'primary') + `</td> </tr>
          <tr> <td>3</td> <td>prim_alt</td> <td> ` + get_doc_text('motif-alt-id', 'primary') + `</td> </tr>
          <tr> <td>4</td> <td>prim_cons</td> <td> ` + get_doc_text('motif-cons', 'primary') + `</td> </tr>
          <tr> <td>5</td> <td>sec_db</td> <td> ` + get_doc_text('motif-db', 'the secondary motif.') + `</td> </tr>
          <tr> <td>6</td> <td>sec_id</td> <td> ` + get_doc_text('motif-id', 'secondary') + `</td> </tr>
          <tr> <td>7</td> <td>sec_alt</td> <td> ` + get_doc_text('motif-alt-id', 'secondary') + `</td> </tr>
          <tr> <td>8</td> <td>sec_cons</td> <td> ` + get_doc_text('motif-cons', 'secondary') + `</td> </tr>
          <tr> <td>9</td> <td>trim_left</td> <td>Number of positions trimmed from left of secondary motif.</td> </tr>
          <tr> <td>10</td> <td>trim_right</td> <td>Number of positions trimmed from right of secondary motif.</td> </tr> 
          <tr> <th colspan=3>If the next three fields are not blank, the motif is redundant with a more significant ('parent') motif.</th> </tr>
          <tr> <td>11</td> <td>red_db</td> <td> ` + get_doc_text('motif-db', 'the parent motif.') + `</td> </tr>
          <tr> <td>12</td> <td>red_id</td> <td> ` + get_doc_text('motif-id', 'parent') + `</td> </tr>
          <tr> <td>13</td> <td>red_alt</td> <td> ` + get_doc_text('motif-alt-id', 'parent') + `</td> </tr>
          <tr> <td>14</td> <td>E-value</td> <td>The expected number motifs that would have least one spacing as enriched as the best spacing for this secondary. 
	    The <i>E</i>-value is the best spacing <i>p</i>-value multiplied by the number of motifs in the input database(s).</td> </tr>
          <tr> <td>15</td> <td>gap</td> <td>The distance between the edge of the primary and the (trimmed) secondary motif.</td> </tr>
          <tr> <td>16</td> <td>orient</td> <td>The (combination) of quadrants for which occurrences of this spacing are combined.</td> </tr>
          <tr> <td>17</td> <td>count</td> <td>The number of occurrences of the secondary motif with the given spacing and orientation to the primary motif.</td> </tr>
          <tr> <td>18</td> <td>total</td> <td>The total number of occurrences of the secondary motif within the margins around the best primary motif occurrence.</td> </tr>
          <tr> <td>19</td> <td>adj_p-value</td> <td>The <i>p</i>-value of the gap and orientation, adjusted for nine combinations of quadrants times the number of gaps tested (as controlled by the <code>-range</code> option).</td> </tr>
          <tr> <td>20</td> <td>p-value</td> <td>The <i>p</i>-value of the gap and orientation adjusted only for the number of gaps tested.</td> </tr>
        </table>
        <br>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'spamo-dumpseqs-tsv':
      html = `
	<p>
	  By specifying the options <code>--dumpseqs</code> or <code>--dumpsigs</code> 
	  you can have SpaMo create TSV (tab-separated values) files
	  describing the motif matches SpaMo used to make the histograms in its HTML output.
	  The files are named 
          '<code>seqs_&lt;primary_motif&gt;_&lt;secondary_db&gt;_&lt;secondary_motif&gt;.txt</code>'.
	  The rows in each file are sorted by sequence name.  
	  The first line contains the (tab-separated) names of the fields.
        </p>
	<p>
	  The names and meanings of each of the fields in <a href="` + site_url + `/doc/spamo-output-format.html#tsv_dumpseqs">SpaMo Dumpseqs TSV Format</a> 
	  are described below. 
        </p>
	<table class="dark" style="width:100%">
	  <tr><th>field</th><th>name</th><th>contents</th></tr>
	  <tr><td>1</td><td>matches</td><td>Trimmed lowercase sequence centered on primary match with matches in uppercase.</td></tr>
	  <tr><td>2</td><td>sec_pos</td><td>Position of the secondary match within the whole sequence.</td></tr>
	  <tr><td>3</td><td>pri_match</td><td>Sequence fragment that the primary matched.</td></tr>
	  <tr><td>4</td><td>pri_strand</td><td>Strand of the primary match (+/-).</td></tr>
	  <tr><td>5</td><td>sec_match</td><td>Sequence fragment that the secondary matched.</td></tr>
	  <tr><td>6</td><td>sec_strand</td><td>Strand of the secondary match (+/-).</td></tr>
	  <tr><td>7</td><td>same_opp</td><td>The primary match on the same (s) or opposite (o) strand as the secondary.</td></tr>
	  <tr><td>8</td><td>down_up</td><td>The secondary match is downstream (d) or upstream (u) of the primary.</td></tr>
	  <tr><td>9</td><td>gap</td><td>The gap between the primary and secondary matches.</td></tr>
	  <tr><td>10</td><td>seq_name</td><td>The name of the sequence.</td></tr>
	  <tr><td>11</td><td>adj_p-value</td><td>The <i>p</i>-value of the bin containing the match, adjusted for the number of bins.</td></tr>
	  <tr><th colspan="3">If the sequence names are in UCSC Genome Browser position
	  format (e.g., "chr5:36715616-36715623"), the following additional fields will be present:</th></tr>
	  <tr><td>12</td><td>pri_bed_chr</td><td>Position of primary match in BED coordinates.</td></tr>
	  <tr><td>13</td><td>pri_bed_start</td><td>"</td></tr>
	  <tr><td>14</td><td>pri_bed_end</td><td>"</td></tr>
	  <tr><td>15</td><td>pri_browser</td><td>Position of primary match in UCSC Genome Browser coordinates.</td></tr>
	  <tr><td>16</td><td>sec_bed_chr</td><td>Position of secondary match in BED coordinates.</td></tr>
	  <tr><td>16</td><td>sec_bed_start</td><td>"</td></tr>
	  <tr><td>16</td><td>sec_bed_end</td><td>"</td></tr>
	  <tr><td>19</td><td>sec_browser</td><td>Position of secondary match in UCSC Genome Browser coordinates.</td></tr>
	</table>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'fimo-results-tsv':
      html = ` 
        <p>
          FIMO outputs a tab-separated values (TSV) file ('fimo.tsv') that contains one line for each
          significant match to a motif.
          The lines are sorted in order of decreasing statistical significance (increasing <i>p</i>-value).
          The first line contains the (tab-separated) names of the fields.
          Your command line is given at the end of the file in a comment line starting with the
          character '#'.
        </p>
	<p>
	  The names and meanings of each of the fields in <a href="` + site_url + `/doc/fimo-output-format.html#results-tsv">FIMO Results TSV Format</a> 
	  are described below. 
	</p>
	<table class="dark" style="width:100%" border=1>
	  <tr> <th>field</th> <th>name</th> <th>contents</th> </tr>
          <tr> <td>1</td> <td>motif_id</td> <td> ` + get_doc_text('motif-id') + `</td> </tr>
          <tr> <td>2</td> <td>motif_alt_id</td> <td> ` + get_doc_text('motif-alt-id') + `</td> </tr>
          <tr> <td>3</td> <td>sequence_name</td> <td> ` + get_doc_text('sequence-id') + ` --OR-- the `
	    + get_doc_text('sequence-name') + `</td> </tr>
          <tr> <td>4</td> <td>start</td> <td> ` + get_doc_text('match-start-seq', 'motif occurrence') + ` --OR-- `
            + get_doc_text('match-start-genomic', 'motif occurrence') 
            + get_doc_text('parse-genomic-coord', 'The latter case occurs when FIMO') + `</td> </tr>
          <tr> <td>5</td> <td>stop</td> <td> ` + get_doc_text('match-stop-seq', 'motif occurrence') + ` --OR-- `
            + get_doc_text('match-stop-genomic', 'motif occurrence') 
            + get_doc_text('parse-genomic-coord', 'The latter case occurs when FIMO') + `</td> </tr>
          <tr> <td>6</td> <td>strand</td> <td>The strand '<code>+</code>' indicates the motif matched the forward
	    strand, '<code>-</code>' the reverse strand, and '<code>.</code>'
	    indicates strand is not applicable (as for amino acid sequences).</td> </tr>
          <tr> <td>7</td> <td>score</td> <td>The score for the motif occurrence. `
            + get_doc_text('motif-match-score') + `</td> </tr>
          <tr> <td>8</td> <td>p-value</td> <td> The <i>p</i>-value of the motif occurrence. `
            + get_doc_text('motif-match-p-value') + `</td> </tr>
          <tr> <td>9</td> <td>q-value</td> <td>The q-value of the motif occurrence. `
            + get_doc_text('bh-q-value', 'FIMO') + ` <b>Note:</b> This column is empty if you used the <span class=popt>--text</span> switch.</td> </tr>
          <tr> <td>10</td> <td>sequence</td> <td>The region of the sequence matched to the motif.</td> </tr>
        </table>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'fimo-results-gff3':
      html = `
        <p>
          FIMO outputs a GFF3</a> file ('fimo.gff') that contains one line for each
          significant match to a motif.
        </p>
        <p>
	  The GFF3 format is described <a href="http://gmod.org/wiki/GFF3">here</a>.
	  The 'score' reported in the FIMO GFF3 output</a> (in column 6) is<br/>
	  &nbsp;&nbsp;&nbsp;&nbsp;<code>min(1000, -10*(log10(pvalue)))</code>, <br/>
	  and the 'display name' ('Name=' tag in column 9) is composed of the contents of three 
	  fields as follows <br/>
	  &nbsp;&nbsp;&nbsp;&nbsp;<code>&lt;motif_id&gt;_&lt;sequence_name&gt;&lt;strand&gt;</code>.
        </p>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'gomo-results-tsv':
      html = `
        <p>
          GOMo outputs a tab-separated values (TSV) file ('gomo.tsv') that contains one line for each 
	  motif-GO-term pair found to be significantly enriched.
          The lines are grouped by motif and sorted in order of decreasing statistical significance.
          The first line contains the (tab-separated) names of the fields.
          Your command line is given at the end of the file in a comment line starting with the character '#'.
        </p>
        <p>
          The names and meanings of each of the fields in <a href="` + site_url + `/doc/gomo-output-format.html#results-tsv">GOMo Results TSV Format</a>
          are described below.
        </p>
        <table class="dark" style="width:100%" border=1>
          <tr> <th>field</th> <th>name</th> <th>contents</th> </tr>
          <tr> <td>1</td> <td>Motif_Identifier</td> <td> ` + get_doc_text('motif-id') + ` </td> </tr> 
          <tr> <td>2</td> <td>GO_Term_Identifier</td> <td> ` + get_doc_text('gomo-go-term') + ` </td> </tr>
          <tr> <td>3</td> <td>GOMo_Score</td> <td> ` + get_doc_text('gomo-score') + ` </td> </tr>
          <tr> <td>4</td> <td>p-value</td> <td> ` + get_doc_text('gomo-p-value') + ` </td> </tr>
          <tr> <td>5</td> <td>q-value</td> <td> ` + get_doc_text('bh-q-value', 'GOMo') + ` </td> </tr>
        </table>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'gomo-results-xml':
      html = `
	<p>
	GOMo outputs an XML file ('gomo.xml') with the following format.
	</p>
	<table class="bordertable" border="1">
	  <tr>
	    <th>Tag</th><th>Child of</th><th>Description</th>
	  </tr>
	  <tr>
	    <td >&lt;gomo&gt;</td><td >Nothing</td>
	    <td>
	      Information about this run of GOMo.
	      <ul>
		<li>version - The version of GOMo that generated the XML file.</li>
		<li>release - The release date of the version that generated the XML.</li>
	      </ul>
	    </td>
	  </tr>
	  <tr>
	    <td >&lt;program&gt;</td>
	    <td >&lt;gomo&gt;</td>
	    <td>
	      Information about the state of the program when it ran.<br />
	      <ul>
		<li>name - name of the program.</li>
		<li>cmd - the command line passed to the program.</li>
		<li>gene_url - the url used to lookup further information on the gene ids. 
		The url has ampersands (&amp;) converted into <b>&amp;amp;</b> and the place where
		  the gene ID should be replaced by <b>!!GENEID!!</b> .</li>
		<li>outdir - the output directory that the program wrote to.</li>
		<li>clobber - true if GOMo was allowed to overwrite the output directory.</li>
		<li>text_only - true if GOMo wrote to stdout, in which case this file would
		  not exist so it must be false.</li>
		<li>use_e_values - true if GOMo used <i>E</i>-values (converted from <i>p</i>-values) as 
		  input scores, false if GOMo used gene scores.</li>
		<li>score_e_thresh - if GOMo used <i>E</i>-values then this is the threshold that 
		  GOMo assumed the worst <i>E</i>-value (<i>p</i>-value = 1.0) for the gene to smooth out noise.</li>
		<li>min_gene_count - the minimum number of genes that a GO term was annotated 
		  with before GOMo would calculate a score for it.</li>
		<li>motifs - if present then a space delimited list of the motifs that GOMo
		  calculated a score for, otherwise GOMo scored all motifs.</li>
		<li>shuffle_scores - the number of times GOMo generated a shuffled mapping of
		  gene id to gene id to be used to generate scores from the null model.</li>
		<li>q_threshold - GOMo filtered the results to only show those with a better
		(smaller) q-value.</li>
	      </ul>
	    </td>
	  </tr>
	  <tr>
	    <td>&lt;gomapfile&gt;</td>
	    <td>&lt;program&gt;</td>
	    <td>
	      Information about the GO mapping file.<br />
	      <ul>
		<li>path - the path to the mapping file.</li>
	      </ul>
	    </td>
	  </tr>
	  <tr>
	    <td>&lt;seqscorefile&gt;</td>
	    <td>&lt;program&gt;</td>
	    <td>
	      Information about the sequence scoring file.<br />
	      <ul>
		<li>path - the path to the sequence scoring file.</li>
	      </ul>
	    </td>
	  </tr>
	  <tr>
	    <td>&lt;motif&gt;</td>
	    <td>&lt;gomo&gt;</td>
	    <td>
	      Information about the motif.<br />
	      <ul>
		<li>id - the motif identifier.</li>
		<li>genecount - the number of scored sequences that were used to compute the result.</li>
	      </ul>
	    </td>
	  </tr>
	  <tr>
	    <td>&lt;goterm&gt;</td>
	    <td>&lt;motif&gt;</td>
	    <td>
	      Information about the GO term.<br />
	      <ul>
		<li>id - the GO identifier.</li>
		<li>score - the geometric mean across all species of the rank-sum test <i>p</i>-value.</li>
		<li>pvalue - the empirically calculated <i>p</i>-value.</li>
		<li>qvalue - the empirically calculated q-value.</li>
		<li>annotated - the number of genes annotated with the go term.</li>
		<li>group - the subgroup that the term belongs to. For the Gene Ontology 
		    b = biological process, c = cellular component and m = molecular function.</li>
		<li>nabove - the number of more general terms that link to this one.</li>
		<li>nbelow - the number of more specific terms that link from this one.</li>
		<li>implied - is the go term implied by other significant go terms? 
		  Allows values 'y', 'n' or 'u' (default) for yes, no or unknown.</li>
		<li>description - the GO term description.</li>
	      </ul>
	    </td>
	  </tr>
	  <tr>
	    <td>&lt;gene&gt;</td>
	    <td>&lt;goterm&gt;</td>
	    <td>
	      Information about the GO term's annotated genes for the primary species.<br />
	      <ul>
		<li>id - the gene identifier.</li>
		<li>rank - the rank of the scored gene.</li>
	      </ul>
	    </td>
	  </tr>
        </table>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'mcast-results-tsv':
      html = ` 
        <p>
          MCAST outputs a tab-separated values (TSV) file ('mcast.tsv') that contains one line for each
          significant match of a cluster of motifs to a sequence region.
          The lines are sorted in order of decreasing statistical significance (increasing <i>p</i>-value).
          The first line contains the (tab-separated) names of the fields.
          Your command line is given at the end of the file in a comment line starting with the
          character '#'.
        </p>
	<p>
	  The names and meanings of each of the fields in 
          <a href="` + site_url + `/doc/mcast-output-format.html#results-tsv">MCAST Results TSV Format</a> 
	  are described below. 
	</p>
	<table class="dark" style="width:100%" border=1>
	  <tr> <th>field</th> <th>name</th> <th>contents</th> </tr>
          <tr> <td>1</td> <td>pattern_name</td> <td>A unique name that MCAST generates for the match. </td> </tr>
          <tr> <td>2</td> <td>sequence_name</td> <td> ` + get_doc_text('sequence-id') + ` --OR-- the `
	    + get_doc_text('sequence-name') + `</td> </tr>
          <tr> <td>3</td> <td>start</td> <td> ` + get_doc_text('match-start-seq', 'matched sequence region') + ` --OR-- `
            + get_doc_text('match-start-genomic', 'motif occurrence')
            + get_doc_text('parse-genomic-coord', 'The latter case occurs when MCAST') + `</td> </tr>
          <tr> <td>4</td> <td>stop</td> <td> ` + get_doc_text('match-stop-seq', 'matched sequence region') + ` --OR-- `
            + get_doc_text('match-stop-genomic', 'motif occurrence')
            + get_doc_text('parse-genomic-coord', 'The latter case occurs when MCAST') + `</td> </tr>
          <tr> <td>5</td> <td>score</td> <td> ` + get_doc_text('mcast-cluster-score') + ` </td> </tr>
          <tr> <td>6</td> <td>p-value</td> <td> ` + get_doc_text('mcast-cluster-p-value') + ` </td> </tr>
          <tr> <td>7</td> <td>E-value</td> <td> ` + get_doc_text('mcast-cluster-E-value') + ` </td> </tr>
          <tr> <td>8</td> <td>q-value</td> <td> ` + get_doc_text('bh-q-value', 'MCAST') + ` 
	    <b>Note:</b> This column is empty if you used the <span class=popt>--text</span> switch.</td> </tr>
          <tr> <td>9</td> <td>sequence</td> <td>The region of the sequence matched to the motif cluster.</td> </tr>
        </table>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'mcast-results-gff3':
      html = `
        <p>
          MCAST outputs a GFF3</a> file ('mcast.gff') that contains one line for each
          significant match to a motif cluster.
        </p>
        <p>
	  The GFF3 format is described <a href="http://gmod.org/wiki/GFF3">here</a>.
	  The 'score' reported in the MCAST GFF3 output</a> (in column 6) is<br/>
	  &nbsp;&nbsp;&nbsp;&nbsp;<code>min(1000, -10*(log10(pvalue)))</code>, <br/>
	  and the 'unique identifier' ('ID=' tag in column 9) is the value of the
	  &lt;pattern_name&gt; field in the MCAST results TSV format.  Following the
	  unique identifier in column 9, the <i>p</i>-value, <i>E</i>-value and q-value
	  of the match are given.
        </p>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'tomtom-results-tsv':
      html = `
	<p>
          Tomtom outputs a tab-separated values (TSV) file ('tomtom.tsv') that contains one line for each motif
	  found to be significantly enriched.
	  The lines are grouped by query motif and sorted in order of decreasing statistical significance.
          The first line contains the (tab-separated) names of the fields.
	  Your command line is given at the end of the file in a comment line starting with the character '#'.
	</p>
	<p>
	  The names and meanings of each of the fields in <a href="` + site_url + `/doc/tomtom-output-format.html#results-tsv">Tomtom Results TSV Format</a> 
	  are described below. 
	</p>
	<table class="dark" style="width:100%" border=1>
	  <tr> <th>field</th> <th>name</th> <th>contents</th> </tr>
          <tr> <td>1</td> <td>Query_ID</td> <td> ` + get_doc_text('motif-id', 'query') + `</td> </tr>
          <tr> <td>2</td> <td>Target_ID</td> <td> ` + get_doc_text('motif-id', 'target') + `</td> </tr>
          <tr> <td>3</td> <td>Optimal_offset</td> <td> ` + get_doc_text('tomtom-offset') + `</td> </tr>
          <tr> <td>4</td> <td>p-value</td> <td> ` + get_doc_text('tomtom-p-value') + `</td> </tr>
          <tr> <td>5</td> <td>E-value</td> <td> ` + get_doc_text('tomtom-E-value') + `</td> </tr>
          <tr> <td>6</td> <td>q-value</td> <td> ` + get_doc_text('bh-q-value', 'Tomtom') + `</td> </tr>
          <tr> <td>7</td> <td>Overlap</td> <td> ` + get_doc_text('tomtom-overlap') + `</td> </tr>
          <tr> <td>8</td> <td>Query_consensus</td> <td>A consensus sequence
                computed from the letter frequencies in the query motif
                (as described <a href="#consensus_doc">below</a>).</td> </tr>
          <tr> <td>9</td> <td>Target_consensus</td> <td>A consensus sequence
                computed from the letter frequencies in the target motif
                (as described <a href="#consensus_doc">below</a>).</td> </tr>
          <tr> <td>10</td> <td>Orientation</td> <td> ` + get_doc_text('tomtom-orientation', "<br>A value of '+' means that the target motif is as it appears in the database. A value of '-' means that the reverse complement of the target motif is shown.") + `</td> </tr>
        </table>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    default:
      html = "Error--Unrecognized doc_type: " + doc_type;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
  }
} // print_doc

//
// Function to return the HTML text of a given type.
// This function can be used directly to document the output format (xx-output-format.html)
// and indirectly via print_doc_para for help pop-ups in the actual output HTML,
// to prevent duplication of documentation.
//
function get_doc_text(doc_type, extra) {
  var html;
  if (extra == undefined) {extra = ""};

  switch (doc_type) {

    // shared
    case 'motif-db':
      return(`
	The name of a file of motifs ("motif database file") that contains ` + extra + `
      `);
    case 'motif-id':
      return(`
	The name of the ` + extra + ` motif, which is unique in the motif database file.
      `);
    case 'motif-alt-id':
      return(`
	An alternate name for the ` + extra + ` motif, which may be provided in the motif database file.
      `);
    case 'motif-width':
      return(`
	The width of the motif. No gaps are allowed in motifs supplied to ` + extra + `
        as it only works for motifs of a fixed width.
      `);
    case 'motif-cons':
      return(`
	A consensus sequence computed from the ` + extra + ` motif (as described <a href="#consensus_doc">below</a>).
      `);
    case 'motif-match-score':
     return(`
	The score for the match of a position in a sequence to a motif is
	computed by summing the appropriate entry from each column of the
	position-dependent scoring matrix that represents the motif. ` + extra + `
     `);
    case 'motif-match-p-value':
      return(`
	The <i>p</i>-value of a motif match is the probability of a single random
	subsequence of the length of the motif
	<a href="javascript:help_refine('pop_motif_match_score')">scoring</a>
	at least as well as the observed match.
      `);
    case 'bh-q-value-method':
      return(`
        ` + extra + ` estimates q-values from all the match <i>p</i>-values 
	using the method proposed by Benjamini & Hochberg (<i>Journal of the Royal Statistical Society B</i>, 57:289-300, 1995).
	See also Storey JD, Tibshirani R. Statistical significance for
	genome-wide studies, <i>Proc. Natl. Acad. Sci. USA</i> (2003) <b>100</b>:9440&ndash;9445.
      `);
    case 'bh-q-value':
      return(`
	The minimum False Discovery Rate (FDR) required to consider this match significant.</br>` + get_doc_text('bh-q-value-method', extra) + `
      `);
    case 'sdb-name':
      return(`
	The name of the (FASTA) sequence database file.
      `);
    case 'sdb-psp':
      return(`
	The name of the position specific priors (PSP) file.
      `);
    case 'sdb-dist':
      return(`
	The name of the binned distribution of priors file.
      `);
    case 'sdb-count':
      return(`
	The number of sequences in the database.
      `);
    case 'sdb-letters':
      return(`
	The number of letters in the sequence database.
      `);
    case 'lastmod':
      return(`
	The date of the last modification to the ` + extra + ` database.
      `);
    case 'sequence-id':
      return(`
        The identifier of the sequence (from the FASTA sequence header line)` + extra + `
      `);
    case 'sequence-name':
      return(`
	` + extra + `name of the sequence extracted from the sequence identifier (in the FASTA sequence header line).<br>
	When you use the <code>--parse-genomic--coord</code> option, the sequence name ends at the
	first colon ':' (if any) present in the sequence\'s FASTA identifier.  Typically this is the
	chromosome or contig name.  With the <code>--parse-genomic--coord</code> option,
	the start and stop positions are in 0-based coordinates relative to the sequence start given 
	in the FASTA sequence identifier (just after the sequence name).</td> </tr>
      `);
    case 'sequence-desc':
      return(`
        The description appearing after the identifier of the sequence in the FASTA header line.
      `);
    case 'sequence-name':
    case 'alph-name':
      return(`
	The name of the alphabet symbol.
      `);
    case 'alph-bg':
      return(`
	The frequency of the alphabet symbol as defined by the background model.
      `);
    case 'match-start-seq':
      return(`
	The start position of the ` + extra + `; 1-based sequence coordinates.
      `);
    case 'match-stop-seq':
      return(`
	The end position of the ` + extra + `; 1-based sequence coordinates.
      `);
    case 'match-start-genomic':
      return(`
	The start position of the ` + extra + `; genomic coordinates.
      `);
    case 'match-stop-genomic':
      return(`
	The end position of the ` + extra + `; genomic coordinates.
      `);
    case 'parse-genomic-coord':
      return(`
	` + extra + ` was run with the <code>--parse-genomic-coord</code> option
	and has split the sequence identifier into sequence name, sequence start and sequence end 
	in genomic coordinates.
      `);

    // AME
    case 'ame-pvalue':
      return(`
	The optimal enrichment <i>p</i>-value of the motif according to the statistical test;
	not adjusted for multiple tests.
      `);
    case 'ame-adj-pvalue':
      return(`
	The optimal enrichment <i>p</i>-value of the motif according to the statistical test,
        adjusted for multiple tests using a Bonferroni correction. ` + extra + `
	If the best <i>p</i>-value is <i>p</i> before adjustment,
        and the number of multiple tests is <i>n</i>, then the adjusted
        <i>p</i>-value is 1 - (1-<i>p</i>)<i><sup>n</sup></i>.
      `);
    case 'ame-evalue':
      return(`
	The expected number of motifs that would be as enriched in the
        (primary) sequences as this one.  The <i>E</i>-value is the adjusted <i>p</i>-value
        multiplied by the number of motifs in the motif file(s).
      `);

    // CentriMo
    case 'centrimo-adj-pvalue':
      return(`
        The statistical significance of the enrichment of the motif, adjusted for multiple tests. ` + extra + `
      `);
    case 'centrimo-evalue':
      var evalue_html = `
        at least one region as enriched for best matches to the motif as the reported region
	(or would have optimal average distance to the sequence center as low as observed, 
	if you used the <code>--cd</code> option).
      `;
      return(`
	The expected number motifs that would have ` + (extra ? extra : evalue_html) + `
	The <i>E</i>-value is the adjusted <i>p</i>-value multiplied by the number of motifs in the
	input files(s).</td> </tr>
      `);
    case 'centrimo-bin-width':
      return(`
        The width (in sequence positions) of the most enriched region (default),
        <b>or</b> two times the average distance between the center of the best site
        and the sequence center if you used the option <code>--cd</code>.
        A best match to the motif is counted as being in the region if
        the center of the motif falls in the region.
      `);
    case 'centrimo-sites-in-bin':
      return(`
	The number of (positive) sequences whose best match to the motif `
	+ (extra ? extra : "falls in the reported region (default) or anywhere in the sequence (if you used the option <code>--cd</code>).") + `
	<br>Note: This number may be less than the number of
	(positive) sequences that have a best match in the region.
	The reason for this is that a sequence may have many matches that score
	equally best.  If <i>n</i> matches have the best score in a sequence, 1/<i>n</i> is added to the
	appropriate bin for each match.</td> </tr>
      `);
    case 'centrimo-mult-tests':
      return(`
	This is the number of multiple tests (<i>n</i>) done for this motif.
	It was used to adjust the <i>p</i>-value of a region for
	multiple tests using the formula:
	<br>&nbsp;&nbsp;
	  <i>p</i>' = 1 - (1-<i>p</i>)<sup><i>n</i></sup> where <i>p</i> is the unadjusted <i>p</i>-value.
	<br>
	The number of multiple tests is the number of regions
	considered times the number of score thresholds considered.
	It depends on the motif length, sequence length, and the type of
	optimizations being done (central enrichment, local enrichment, central distance or
	score optimization).</td> </tr>
      `);

    // GOMo
    case 'gomo-go-term':
      return(`
        The Gene Ontology Consortium term for a specific role or locality.
        Used for annotating genes with their functions.
      `);
    case 'gomo-score':
      return( `
	A score generated as the <a href="https://en.wikipedia.org/wiki/Geometric_mean">
	geometric mean</a> of <a href="https://en.wikipedia.org/wiki/Mann-Whitney_U_test">rank-sum test(s)</a> 
	for the particular Gene Ontology term. The two groups compared by the rank-sum test are scores of genes annotated 
	with the GO term and scores of genes not annotated with the GO term.</td> </tr>
      `);
    case 'gomo-p-value':
      return( `
	An empirically generated <i>p</i>-value for the enrichment of the GO term.<br>
	The null hypothesis is that by shuffling the labels on gene scores, 
	any possible association between the set of genes that a GO term annotates is destroyed. 
	A large number of scores are generated using the null hypothesis and the number of null 
	hypothesis scores that are better than each of the real scores is summed and then divided 
	by the total null hypothesis scores generated to calculate a <i>p</i>-value.</td> </tr>
      `);

    // MAST

    // MCAST
    case 'mcast-cluster-score':
      return( `
        The score that the hidden Markov model created by MCAST assigned to the motif cluster.<br>
        This is the sum of the scores of the individual motif matches in the cluster, plus a
        gap penalty, <i>g</i>, multiplied by the total size of the inter-motif gaps
        in the cluster.  Individual motif match scores are log2(<i>P(s)/p</i>), where <i>s</i> is the 
        <a href="javascript:help_refine('pop_motif_match_score')">log-odds score</a> 
        of the motif match, <i>P(s)</i> is the 
        <a href="javascript:help_refine('pop_motif_match_pvalue')"><i>p</i>-value</a> 
	of the motif match, and <i>p</i> is the user-specified <i>p</i>-value threshold (default: 0.0005).
        <div class="active" id="pop_motif_match_score_act"></div>
        <div class="active" id="pop_motif_match_pvalue_act"></div>
      `);
    case 'mcast-cluster-p-value':
      return( `
	The <i>p</i>-value of the motif cluster score.<br>
	MCAST estimates <i>p</i>-values by fitting an exponential distribution
	to the observed motif cluster scores.
      `);
    case 'mcast-cluster-E-value':
      return( `
        The <i>E</i>-value of the motif cluster score.<br>
	The <i>E</i>-value is an estimate of the <i>number</i> of false positive matches
	with <i>p</i>-values at least as good as this match\'s.  
        MCAST estimates this by multiplying the motif cluster score <i>p</i>-value
        times the (estimated) number of random matches found in the search.
      `);

    // Tomtom
    case 'tomtom-offset':
      return( `
        The offset of the query motif relative to the target motif in the optimal alignment.<br>
 	A positive value indicates the query is shifted right.
      `);
    case 'tomtom-p-value':
      return( `
        The probability that a random motif of the same width as the target would have an 
	optimal alignment with a match score as good or better than the target's.<br>
	Tomtom estimates the <i>p</i>-value using a null model consisting of sampling
	motif columns from all the columns in the set of target motifs.
      `);
    case 'tomtom-E-value':
      return( `
	The expected number of false positives in the matches up to this point.<br>
	Tomtom estimates the <i>E</i>-value by multiplying the <i>p</i>-value by
	the total number of target motifs in all the target databases.
      `);
    case 'tomtom-overlap':
      return( `
	The number of motif columns that overlap in the optimal alignment.
      `);
    case 'tomtom-orientation':
      return( `
	The orientation of the target motif that gave the optimal alignment. ` + extra + `
      `);
  }

} // get_doc_text

//
// Function to replace the innerHTML of element "id" with an HTML paragraph
// containing the text for 'doc_type', which is known to function get_doc_text.
// This function can be used in help pop-ups.
//
function print_doc_para(id, doc_type, extra) {
  html = `<p>` + get_doc_text(doc_type, extra) + `</p>`; 
  document.getElementById(id).insertAdjacentHTML('beforeend', html);
} // print_doc_para

    </script>
    <script type="text/javascript">
function make_alpha_bg_table(alph, freqs) {
  function colour_symbol(index) {
    var span = document.createElement("span");
    span.appendChild(document.createTextNode(alph.get_symbol(index)));
    span.style.color = alph.get_colour(index);
    span.className = "alpha_symbol";
    return span;
  }
  var table, thead, tbody, row, th, span, i;
  // create table
  table = document.createElement("table");
  table.className = "alpha_bg_table";
  // create header
  thead = document.createElement("thead");
  table.appendChild(thead);
  row = thead.insertRow(thead.rows.length);
  if (alph.has_complement()) {
    add_text_header_cell(row, "Name", "pop_alph_name");
    if (freqs != null) add_text_header_cell(row, "Freq.", "pop_alph_freq");
    if (alph.has_bg()) add_text_header_cell(row, "Bg.", "pop_alph_bg");
    add_text_header_cell(row, "");
    add_text_header_cell(row, "");
    add_text_header_cell(row, "");
    if (alph.has_bg()) add_text_header_cell(row, "Bg.", "pop_alph_bg");
    if (freqs != null) add_text_header_cell(row, "Freq.", "pop_alph_freq");
    add_text_header_cell(row, "Name", "pop_alph_name");
  } else {
    add_text_header_cell(row, "");
    add_text_header_cell(row, "Name", "pop_alph_name");
    if (freqs != null) add_text_header_cell(row, "Freq.", "pop_alph_freq");
    if (alph.has_bg()) add_text_header_cell(row, "Bg.", "pop_alph_bg");
  }
  // add alphabet entries
  tbody = document.createElement("tbody");
  table.appendChild(tbody);
  if (alph.has_complement()) {
    for (i = 0; i < alph.get_size_core(); i++) {
      var c = alph.get_complement(i);
      if (i > c) continue;
      row = tbody.insertRow(tbody.rows.length);
      add_text_cell(row, alph.get_name(i));
      if (freqs != null) add_text_cell(row, "" + freqs[i]);
      if (alph.has_bg()) add_text_cell(row, "" + alph.get_bg_freq(i));
      add_cell(row, colour_symbol(i)); 
      add_text_cell(row, "~");
      add_cell(row, colour_symbol(c)); 
      if (alph.has_bg()) add_text_cell(row, "" + alph.get_bg_freq(c));
      if (freqs != null) add_text_cell(row, "" + freqs[c]);
      add_text_cell(row, alph.get_name(c));
    }
  } else {
    for (i = 0; i < alph.get_size_core(); i++) {
      row = tbody.insertRow(tbody.rows.length);
      add_cell(row, colour_symbol(i)); 
      add_text_cell(row, alph.get_name(i));
      if (freqs != null) add_text_cell(row, "" + freqs[i]);
      if (alph.has_bg()) add_text_cell(row, "" + alph.get_bg_freq(i));
    }
  }
  return table;
}


    </script>
    <script type="text/javascript">
var LEGEND_LINE = 16;
var LEGEND_FONT = "Helvetica";
var LEGEND_PAD = 5;

var Dasher = function(ctx, start_x, start_y, pattern) {
  if (typeof pattern === "undefined") pattern = [];
  this.ctx = ctx;
  this.x = start_x;
  this.y = start_y;
  this.pattern = pattern;
  this.index = 0;     // where in the pattern are we up to?
  this.fragment = 0;  // how much of the current pattern have we drawn
  this.on = true;     // pen on paper?
  ctx.moveTo(start_x, start_y);
};

Dasher.prototype.dashTo = function(x, y) {
  var dx = x - this.x;
  var dy = y - this.y;
  var d = Math.pow(dx * dx + dy * dy, 0.5);
  if (this.pattern.length == 0) {
    // when no pattern is specified this just draws lines
    this.ctx.lineTo(x, y);
  } else {
    // calculate distance to complete dash
    var dc = this.pattern[this.index] - this.fragment;
    while (dc <= d) {
      // calculate the fraction of the line needed
      var f = dc / d;
      this.x += dx * f;
      this.y += dy * f;
      if (this.on) {
        this.ctx.lineTo(this.x, this.y);
      } else {
        this.ctx.moveTo(this.x, this.y);
      }
      // move to the next dash
      this.fragment = 0;
      // skip empty dashes, just toggling on state
      do {
        this.index = (this.index + 1) % this.pattern.length;
        this.on = !this.on;
      } while (this.pattern[this.index] <= 0);
      // update variables
      dc = this.pattern[this.index];
      dx = x - this.x;
      dy = y - this.y;
      d = Math.pow(dx * dx + dy * dy, 0.5);
    }
    this.fragment += d;
    this.x = x;
    this.y = y;
    if (this.on) {
      this.ctx.lineTo(this.x, this.y);
    } else {
      this.ctx.moveTo(this.x, this.y);
    }
  }
}

var CentrimoResult = function(name, sig, colour, motif_length, 
    total_sites, site_counts, neg_total_sites, neg_site_counts) {
  "use strict";
  if (typeof name === "undefined") {
    name = "";
  }
  if (typeof sig === "undefined") {
    sig = "";
  }
  if (typeof colour == "undefined") {
    colour = "#000000";
  }
  this.name = name;
  this.sig = sig;
  this.colour = colour;
  this.motif_length = motif_length;
  this.total_sites = total_sites;
  this.site_counts = site_counts;
  this.has_neg = (typeof neg_total_sites === "number" && 
      typeof neg_site_counts === "object" && neg_site_counts instanceof Array);
  this.neg_total_sites = neg_total_sites;
  this.neg_site_counts = neg_site_counts;
};

CentrimoResult.prototype.get_site_count = function (index, mirror, neg) {
  count = neg ? this.neg_site_counts[index] : this.site_counts[index];
  if (mirror) {
    i_mirror = this.site_counts.length - 1 - index;
    return (count + (neg ? this.neg_site_counts[i_mirror] : this.site_counts[i_mirror]));
  } else {
    return count;
  }
};

/*
 * CentrimoRSet
 * Construct a centrimo result set.
 */
var CentrimoRSet = function(sequence_length) {
  "use strict";
  this.sequence_length = sequence_length;
  this.results = [];
};

/*
 * seq_len
 * Get the sequence length of the result set.
 */
CentrimoRSet.prototype.seq_len = function() {
  "use strict";
  return this.sequence_length;
};

/*
 * add
 * Add a centrimo result to the set
 */
CentrimoRSet.prototype.add = function(name, sig, colour, motif_length, 
    total_sites, site_counts, neg_total_sites, neg_site_counts) {
  "use strict";
  this.results.push(new CentrimoResult(name, sig, colour, motif_length, 
    total_sites, site_counts, neg_total_sites, neg_site_counts));
};

/*
 * count
 * Return the count of centrimo results.
 */
CentrimoRSet.prototype.count = function() {
  "use strict";
  return this.results.length;
};

/*
 *  get
 *  Get an entry in the result set.
 */
CentrimoRSet.prototype.get = function(index) {
  "use strict";
  return this.results[index];
};

/*
 * CentrimoLine
 */
var CentrimoLine = function(name, sig, colour, dash, thickness, show_on_legend, xlist, ylist) {
  "use strict";
  if (xlist.length != ylist.length) {
    throw new Error("The list of x and y points must be the same length.");
  }
  this.xlist = xlist;
  this.ylist = ylist;
  this.name = name;
  this.sig = sig;
  this.colour = colour;
  this.dash = dash;
  this.thickness = thickness;
  this.show_on_legend = show_on_legend;
  this.max_prob = -1;
};

/*
 * trim
 *
 * Removes points from the ends so the lines are the same length.
 */
CentrimoLine.prototype.trim = function(left, right) {
  "use strict";
  var lefti, righti, gradient, gap, left_y, right_y;
  if (this.xlist.length == 0) return;
  if (typeof left !== "number"|| isNaN(left)) {
    throw new Error("left trim is not a number");
  }
  if (typeof right !== "number" || isNaN(right)) {
    throw new Error("right trim is not a number");
  }
  for (lefti = 0; lefti < this.xlist.length; lefti++) {
    if (this.xlist[lefti] >= left) {
      break;
    }
  }
  if (lefti === 0 && this.xlist[0] !== left) {
    throw new Error("Attempt to undertrim line on the left.");
  }
  for (righti = this.xlist.length - 1; righti >= 0; righti--) {
    if (this.xlist[righti] <= right) {
      break;
    }
  }
  if (righti === (this.xlist.length - 1) && this.xlist[righti] !== right) {
    throw new Error("Attempt to undertrim line on the right.");
  }
  if (lefti == this.xlist.length || righti == -1) {
    // all points outside of drawable region
    this.xlist = [];
    this.ylist = [];
    return;
  }
  if (this.xlist[lefti] != left) {
    // create a new point that is exactly at left by interpolating
    gradient = (this.ylist[lefti] - this.ylist[lefti-1]) / 
      (this.xlist[lefti] - this.xlist[lefti-1]);
    gap = left - this.xlist[lefti-1];
    left_y = this.ylist[lefti-1] + gradient * gap;
    this.xlist.splice(0, lefti, left);
    this.ylist.splice(0, lefti, left_y);
    righti = righti - lefti + 1;
  } else {
    this.xlist.splice(0, lefti);
    this.ylist.splice(0, lefti);
    righti -= lefti;
  }
  if (this.xlist[righti] != right) {
    // create a new point that is exactly at right by interpolating
    gradient = (this.ylist[righti + 1] - this.ylist[righti]) /
      (this.xlist[righti + 1] - this.xlist[righti]);
    gap = right - this.xlist[righti];
    right_y = this.ylist[righti] + gradient * gap;
    // truncate the lists
    this.xlist.length = righti + 1;
    this.ylist.length = righti + 1;
    // push the new item on the end of the lists
    this.xlist.push(right);
    this.ylist.push(right_y);
  } else {
    // truncate the lists
    this.xlist.length = righti + 1;
    this.ylist.length = righti + 1;
  }
  this.max_prob = -1;
};

CentrimoLine.prototype.max = function() {
  "use strict";
  var y_max, i;
  if (this.max_prob != -1) {
    return this.max_prob;
  }
  y_max = 0;
  for (i = 0; i < this.xlist.length; i++) {
    if (this.ylist[i] > y_max) {
      y_max = this.ylist[i];
    }
  }
  this.max_prop = y_max;
  return this.max_prop;
};

/*
 * CentrimoScale
 *
 * Calculates the increments on the y axis
 */
var CentrimoScale = function(max_prob) {
  "use strict";
  var decimals, inc, rounder, max, inc_plus;
  if (max_prob === 0) {
    this.max = 0.01;
    this.inc = 0.002;
    this.digits = 3;
    return;
  }
  // find the minimum number of decimals needed to display the largest
  // digit of the maximum probability
  decimals = Math.ceil(-(Math.log(max_prob) / Math.log(10)));
  // calculate an increment which is (at minimum) 10 times smaller the the max
  inc = Math.pow(10, -(decimals+1));
  // round-up the maximum probabilty to its largest digit
  rounder = Math.pow(10, decimals);
  max = Math.ceil(max_prob * rounder) / rounder;
  // adjust the increment so it's between 5 and 12 times the maximum
  // probability
  if (inc * 5 < max && inc * 12 > max) {
    inc *= 1;
  } else if (inc * 10 < max && inc * 24 > max) {
    inc *= 2;
  } else if (inc * 25 < max && inc * 60 > max) {
    inc *= 5;
  } else if (inc * 50 < max && inc * 120 > max) {
    inc *= 10;
  }
  max += inc;
  inc_plus = (1.125 * inc);
  while (max - inc_plus > max_prob) {
    max -= inc;
  }
  max = Math.min(max, 1.0);
  this.max = max;
  this.inc = inc;
  this.digits = decimals+1;
};

var CentrimoLegendMetrics = function(lw, lh, id_w, pv_w, sq_w) {
  "use strict";
  this.width = lw;
  this.height = lh;
  this.id_width = id_w;
  this.pv_width = pv_w;
  this.sq_width = sq_w;
};

var CentrimoGraphMetrics = function(legend_metrics, top_edge, bottom_edge,
    left_mark, left_val, right_mark, right_val) {
  if (typeof legend_metrics !== "object" || legend_metrics === null) {
    this.legend_width = 10;
    this.legend_height = 10;
  } else {
    this.legend_width = legend_metrics.width;
    this.legend_height = legend_metrics.height;
  }
  this.top_edge = top_edge;
  this.bottom_edge = bottom_edge;
  this.left_mark = left_mark;
  this.left_val = left_val;
  this.right_mark = right_mark;
  this.right_val = right_val;
};

/*
 * CentrimoGraph
 * Takes a results set and a window weight array and produces a graph. 
 * The weights in the window_weights should be non-negative and sum to 1.
 */
var CentrimoGraph = function(rset, window_weights, fine_text, start, end, mirror) {
  "use strict";
  var trim_left, trim_right, i, j, k, result, x, y, xpos, ypos, positions;
  var y_neg, ypos_neg, line_thickness;

  line_thickness = (window_weights.length < 10 ? 1 : 3);
  if (typeof fine_text !== "string") {
    fine_text = "";
  }
  if (typeof mirror !== "boolean") mirror = false;
  this.mirror = mirror;
  if (mirror) {
    if (typeof start === "number") {
      start = Math.max(0, start);
    } else {
      start = 0;
    }
  }
  this.fine_text = fine_text;
  this.lines = [];
  for (i = 0; i < rset.count(); i++) {
    result = rset.get(i);
    x = [];
    y = [];
    if (result.has_neg) {
      y_neg = [];
    }
    xpos = (result.motif_length - rset.seq_len() + (window_weights.length - 1)) / 2;
    if (typeof trim_left === "undefined") {
      trim_left = xpos;
    } else if (trim_left < xpos) {
      trim_left = xpos;
    }
    positions = result.site_counts.length - window_weights.length + 1;
    for (j = 0; j < positions; j++, xpos += 1) {
      ypos = 0;
      // avoid division by zero when no sites are found
      if (result.total_sites > 0) {
        for (k = 0; k < window_weights.length; k++) {
          ypos += window_weights[k] * result.get_site_count(j + k, mirror, 0);
        }
        ypos /= result.total_sites;
      }
      x.push(xpos);
      y.push(ypos);
      // handle the negative dataset
      if (result.has_neg) {
        ypos_neg = 0;
        if (result.neg_total_sites > 0) {
          for (k = 0; k < window_weights.length; k++) {
            ypos_neg += window_weights[k] * result.get_site_count(j + k, mirror, 1);
          }
          ypos_neg /= result.neg_total_sites;
        }
        y_neg.push(ypos_neg);
      }
    }
    // subtract 1 from xpos because for loop will increment it one more than needed.
    xpos -= 1;
    this.lines.push(new CentrimoLine(result.name, result.sig, result.colour, [], line_thickness, true, x, y));
    if (result.has_neg) {
      this.lines.push(new CentrimoLine(result.name, result.sig, result.colour, [6,4], 2, false, x.slice(0), y_neg));
    }
    if (positions > 0) {
      if (typeof trim_right === "undefined") {
        trim_right = xpos;
      } else if (trim_right > xpos) {
        trim_right = xpos;
      }
    }
  }
  if (typeof start !== "undefined" && start != null) {
    if (start > trim_left) {
      trim_left = start;
    }
    this.start = start;
  } else {
    this.start = -Math.ceil(rset.seq_len() / 2);
  }
  if (typeof end !== "undefined" && end != null) {
    if (end < trim_right) {
      trim_right = end;
    }
    this.end = end;
  } else {
    this.end = Math.floor(rset.seq_len() / 2);
  }
  this.max_prob = 0;
  for (i = 0; i < this.lines.length; i++) {
    this.lines[i].trim(trim_left, trim_right);
    this.max_prob = Math.max(this.max_prob, this.lines[i].max());
  }
  this.scale = new CentrimoScale(this.max_prob);
};

/*
 * draw_graph
 *
 * Draws a motif probability graph
 */
CentrimoGraph.prototype.draw_graph = function (ctx, w, h, draw_legend, legend_x, legend_y) {
  "use strict";
  var gap, l_margin, t_margin, b_margin, r_margin, legend_metrics, 
      legend_width, legend_height;
  gap = 10;
  l_margin = gap + 30 + 10 * (2 + this.scale.digits);
  t_margin = 20;
  b_margin = 60;
  r_margin = 30;
  legend_metrics = this.measure_legend(ctx);
  // setting global
  legend_width = legend_metrics.width;
  legend_height = legend_metrics.height;
  // constrain legend to within graph area
  legend_x = Math.round(legend_x);
  legend_y = Math.round(legend_y);
  if (legend_x < (l_margin + gap)) {
    legend_x = l_margin + gap;
  } else if ((legend_x + legend_metrics.width) > (w - r_margin - gap)) {
    legend_x = w - r_margin - legend_metrics.width - gap;
  }
  if (legend_y < (t_margin + gap)) {
    legend_y = t_margin + gap;
  } else if ((legend_y + legend_metrics.height) > (h - b_margin - gap)) {
    legend_y = h - b_margin - legend_metrics.height - gap;
  }

  // draw graph
  ctx.save();
  // draw border
  ctx.beginPath();
  ctx.moveTo(l_margin - 0.5, t_margin +0.5);
  ctx.lineTo(l_margin - 0.5, h - (b_margin - 0.5));
  ctx.lineTo(w - r_margin - 0.5, h - (b_margin - 0.5));
  ctx.lineTo(w - r_margin - 0.5, t_margin +0.5);
  ctx.closePath();
  ctx.stroke();
  // draw fineprint
  ctx.save();
  ctx.font = "9px Helvetica";
  ctx.textAlign = "right";
  ctx.textBaseline = "bottom";
  ctx.fillText(this.fine_text, w - 1, h - 2);
  ctx.restore();
  // draw y axis
  ctx.save();
  ctx.translate(l_margin, t_margin);
  this.draw_y_axis(ctx, 0, h - (t_margin + b_margin));
  ctx.restore();
  // draw y labels
  ctx.save();
  ctx.translate(gap, t_margin);
  this.draw_y_axis_label(ctx, l_margin, h - (t_margin + b_margin));
  ctx.restore();
  // draw x axis
  ctx.save();
  ctx.translate(l_margin, h - b_margin);
  this.draw_x_axis(ctx, w - (l_margin + r_margin), b_margin);
  ctx.restore();
  // draw top axis
  ctx.save();
  ctx.translate(l_margin, t_margin);
  this.draw_top_axis(ctx, w - (l_margin + r_margin), 0);
  ctx.restore();
  // draw x axis labels
  ctx.save();
  ctx.translate(l_margin, h - b_margin);
  this.draw_x_axis_label(ctx, w - (l_margin + r_margin), b_margin - gap);
  ctx.restore();
  // draw lines
  ctx.save();
  ctx.translate(l_margin, t_margin);
  this.draw_lines(ctx, w - (l_margin + r_margin), h - (t_margin + b_margin), 8);
  ctx.restore();
  // draw legend
  if (draw_legend) { 
    ctx.save();
    ctx.translate(legend_x, legend_y);
    this.draw_legend(ctx, legend_metrics);
    ctx.restore();
  }
  ctx.restore();
  return new CentrimoGraphMetrics(legend_metrics, t_margin, h - b_margin,
      l_margin, this.start, w - r_margin, this.end);
};

/*
 * draw_x_axis
 *
 */
CentrimoGraph.prototype.draw_x_axis = function(ctx, w, h) {
  "use strict";
  var scale_x, length, tic_inc, tic_min, tic_max, i, x;
  // pixels per unit
  scale_x = w / (this.end - this.start);
  // calculate a good tic increment
  length = this.end - this.start;
  if (length > 50) {
    // multiple of 10
    tic_inc = Math.max(1, Math.round(length / 100)) * 10;
  } else if (length > 25) {
    tic_inc = 5;
  } else if (length > 10) {
    tic_inc = 2;
  } else {
    tic_inc = 1;
  }
  // work out the min and max values within the start and end
  tic_min = Math.round(this.start / tic_inc) * tic_inc;
  if (tic_min < this.start) {
    tic_min += tic_inc;
  }
  tic_max = Math.round(this.end / tic_inc) * tic_inc;
  if (tic_max > this.end) {
    tic_max -= tic_inc;
  }
  // draw the tics
  ctx.save();
  ctx.font = "14pt Helvetica";
  ctx.textBaseline = "top";
  ctx.textAlign = "center";
  for (i = tic_min; i <= tic_max; i+= tic_inc) {
    x = Math.round((i - this.start) * scale_x) + 0.5;
    ctx.fillText(""+i, x, 5);
    if (i == this.start || i == this.end) continue;
    ctx.beginPath();
    ctx.moveTo(x, -5);
    ctx.lineTo(x, 3);
    ctx.stroke();
  }
  
  ctx.restore();
};

/*
 * draw_top_axis
 *
 */
CentrimoGraph.prototype.draw_top_axis = function(ctx, w, h) {
  "use strict";
  var scale_x, length, tic_inc, tic_min, tic_max, i, x;
  // pixels per unit
  scale_x = w / (this.end - this.start);
  // calculate a good tic increment
  length = this.end - this.start;
  if (length > 50) {
    // multiple of 10
    tic_inc = Math.max(1, Math.round(length / 100)) * 10;
  } else if (length > 25) {
    tic_inc = 5;
  } else {
    tic_inc = 1;
  }
  // work out the min and max values within the start and end
  tic_min = Math.round(this.start / tic_inc) * tic_inc;
  if (tic_min < this.start) {
    tic_min += tic_inc;
  }
  tic_max = Math.round(this.end / tic_inc) * tic_inc;
  if (tic_max > this.end) {
    tic_max -= tic_inc;
  }
  // draw the tics
  ctx.save();
  ctx.font = "14pt Helvetica";
  ctx.textBaseline = "top";
  ctx.textAlign = "center";
  for (i = tic_min; i <= tic_max; i+= tic_inc) {
    if (i == this.start || i == this.end) continue;
    x = Math.round((i - this.start) * scale_x) + 0.5;
    ctx.beginPath();
    ctx.moveTo(x, 0);
    ctx.lineTo(x, 8);
    ctx.stroke();
  }
  ctx.restore();
};

/*
 * draw_x_axis_label
 */
CentrimoGraph.prototype.draw_x_axis_label = function(ctx, w, h) {
  "use strict";
  ctx.save();
  ctx.font = "14pt Helvetica";
  ctx.textAlign = "center";
  ctx.textBaseline = "bottom";
  ctx.fillText((this.mirror ? 
        "Distance of Best Site from Sequence Center" : 
        "Position of Best Site in Sequence"), w/2, h);
  ctx.restore();
};

/*
 * draw_y_axis
 *
 * TODO some work needs to be done to allow moving the zero
 */
CentrimoGraph.prototype.draw_y_axis = function(ctx, w, h) {
  "use strict";
  var y_scale, p, y;
  ctx.save();
  ctx.font = "14pt Helvetica";
  ctx.textBaseline = "middle";
  ctx.textAlign = "right";

  y_scale = h / this.scale.max;
  for (p = 0; p < this.scale.max; p += this.scale.inc) {
    y = Math.round(h - p * y_scale) + 0.5;
    this.draw_y_tic(ctx, this.scale.digits, y, p);
  }
  this.draw_y_tic(ctx, this.scale.digits, 0.5, this.scale.max);

  ctx.restore();
};

/*
 * draw_y_tic
 */
CentrimoGraph.prototype.draw_y_tic = function(ctx, digits, y, p) {
  "use strict";
  ctx.beginPath();
  ctx.moveTo(5, y);
  ctx.lineTo(-3, y);
  ctx.stroke();
  ctx.fillText(p.toFixed(digits), -5, y);
};

/*
 * draw_y_axis_label
 */
CentrimoGraph.prototype.draw_y_axis_label = function(ctx, w, h) {
  "use strict";
  ctx.save();
  ctx.translate(0, h/2);
  ctx.rotate(-Math.PI / 2);
  ctx.font = "14pt Helvetica";
  ctx.textBaseline = "top";
  ctx.textAlign = "center";
  ctx.fillText("Probability", 0, 0);
  ctx.restore();
};

/*
 * draw_lines
 */
CentrimoGraph.prototype.draw_lines = function(ctx, w, h, tic_size) {
  "use strict";
  var scale_y, scale_x, i, line, x_points, y_points, j, x, y, dasher;
  if (typeof tic_size === "undefined") {
    tic_size = 0;
  }
  scale_y = h / this.scale.max;
  scale_x = w / (this.end - this.start);
  // draw the central line
  if (0 > this.start && 0 < this.end) {
    ctx.save();
    ctx.translate((-this.start) * scale_x, 0);
    ctx.strokeStyle = '#DDD';
    ctx.beginPath();
    ctx.moveTo(0.5, tic_size);
    ctx.lineTo(0.5, h - tic_size);
    ctx.stroke();
    ctx.restore();
  }
  // draw the lines
  ctx.save();
  ctx.lineJoin = "bevel";
  ctx.miterLimit = 0;
  for (i = 0; i < this.lines.length; i++) {
    line = this.lines[i];
    ctx.lineWidth = line.thickness;
    x_points = line.xlist;
    y_points = line.ylist;
    if (x_points.length > 1) {
      ctx.strokeStyle = line.colour;
      ctx.beginPath();
      for (j = 0; j < x_points.length; j++) {
        if (isNaN(x_points[j])) {
          throw new Error("X NaN!");
        }
        if (isNaN(y_points[j])) {
          throw new Error("Y NaN!");
        }
        x = (x_points[j] - this.start) * scale_x;
        y = h - y_points[j] * scale_y;
        if (j === 0) {
          dasher = new Dasher(ctx, x, y, line.dash);
        } else {
          dasher.dashTo(x, y);
        }
      }
      ctx.stroke();
    } else if (x_points.length == 1) {
      if (isNaN(x_points[0])) {
        throw new Error("X NaN!");
      }
      if (isNaN(y_points[0])) {
        throw new Error("Y NaN!");
      }
      x = (x_points[0] - this.start) * scale_x;
      y = h - y_points[0] * scale_y;
      ctx.fillStyle = line.colour;
      ctx.beginPath();
      ctx.arc(x, y, 2, 0, 2*Math.PI, false);
      ctx.fill();
    }
  }
  ctx.restore();
};

/*
 * measure_legend
 */
CentrimoGraph.prototype.measure_legend = function(ctx) {
  "use strict";
  var lw, lh, sq_w, id_w, pv_w, lines, i, line, len;
  // initilise the line height to the size of the padding
  lh = 2 * LEGEND_PAD;
  // calculate the column widths
  sq_w = LEGEND_LINE - 2;
  id_w = 0;
  pv_w = 0;
  ctx.save();
  ctx.font = "" + LEGEND_LINE + "px " + LEGEND_FONT; 
  for (i = 0; i < this.lines.length; i++) {
    line = this.lines[i];
    if (!line.show_on_legend) {
      continue;
    }
    lh += LEGEND_LINE * 1.2;
    len = ctx.measureText(line.name).width;
    if (id_w < len) {
      id_w = len;
    }
    len = ctx.measureText(line.sig).width;
    if (pv_w < len) {
      pv_w = len;
    }
  }
  lh = Math.round(lh);
  ctx.restore();
  // legend width is a function of the column widths
  lw = id_w + pv_w + sq_w + 4 * LEGEND_PAD;

  return new CentrimoLegendMetrics(lw, lh, id_w, pv_w, sq_w);
};

/*
 * draw_legend
 */
CentrimoGraph.prototype.draw_legend = function(ctx, metrics) {
  "use strict";
  var ln_h, pad, w, h, id_w, pv_w, sq_w, id_x, pv_x, sq_x, i, line;
  if (this.lines.length === 0) {
    return;
  }
  ln_h = LEGEND_LINE;
  pad = LEGEND_PAD;
  w = metrics.width;
  h = metrics.height;
  id_w = metrics.id_width;
  pv_w = metrics.pv_width;
  sq_w = metrics.sq_width;
  id_x = 0;
  pv_x = id_x + id_w + pad;
  sq_x = pv_x + pv_w + pad;

  ctx.save();
  ctx.font = "" + ln_h + "px " + LEGEND_FONT;
  ctx.textAlign = "left";
  ctx.textBaseline = "alphabetic";
  // draw it
  ctx.save();
  ctx.fillStyle = 'white';
  ctx.fillRect(0.5, 0.5, w-1, h-1);
  ctx.strokeStyle = 'black';
  ctx.strokeRect(0.5, 0.5, w-1, h-1);
  ctx.restore();
  ctx.translate(pad, pad);
  ctx.fillStyle = "black";
  for (i = 0; i < this.lines.length; i++) {
    line = this.lines[i];
    if (!line.show_on_legend) {
      continue;
    }
    ctx.translate(0, ln_h);
    ctx.save();
    ctx.fillStyle = line.colour;
    ctx.fillRect(sq_x, -sq_w + 0.1 * ln_h, sq_w, sq_w);
    ctx.restore();
    ctx.fillText(line.name, id_x, 0);
    ctx.fillText(line.sig, pv_x, 0);
    ctx.translate(0, 0.2 * ln_h);
  }
  ctx.restore();
};

/*
 * triangular_weights
 * Returns an array of length n containing normalized weights.
 *
 */
function triangular_weights(n) {
  "use strict";
  var weights, half, half_i, sum, i, unscaled_weight;
  weights = [];
  half = n/2;
  half_i = Math.floor(half);
  sum = 0;
  for (i = 0; i < half_i; i++) {
    unscaled_weight = (i + 0.5) / half;
    weights[i] = unscaled_weight;
    weights[n - i -1] = unscaled_weight;
    sum += 2 * unscaled_weight;
  }
  if (n % 2 == 1) {
    weights[half_i] = 1;
    sum += 1;
  }
  // normalize
  for (i = 0; i < n; i++) {
    weights[i] /= sum;
  }
  return weights;
}

/*
 * uniform_weights
 * Returns an array of length n containing normalized weights.
 *
 */
function uniform_weights(n) {
  "use strict";
  var weights, weight, i;
  weights = [];
  weight = 1.0 / n;
  for (i = 0; i < n; i++) {
    weights[i] = weight;
  }
  return weights;
}

    </script>
    <script type="text/javascript">
var centrimo_alphabet = new Alphabet(data.alphabet, data.background);
var palate = ["white", "cyan", "blue", "#FF00FF", "#00FF00", "red", "orange", "#008000", "#8A2BE2", "black"];
var text_palate = ["black", "black", "white", "white", "black", "white", "black", "white", "white", "white"];
var INT_MAX = 9007199254740992;
var default_smoothing_window = 20;

var s_motifs = [];
var s_swatches = [];
var s_logos = []
var s_count = 0;
var swap = null;
var alphabet = new Alphabet(data.alphabet, data.background);
var logo_timer = null; // timer to draw motif when the mouse pauses on a row
var logo_motif = null; // motif to draw when timer expires
var logo_row = null; // the row (or tbody) that the mouse is over
var legend_x = 1000;
var legend_y = 1000;
var union_seq_ids = [];
var intersect_seq_ids = [];
var graph_metrics = new CentrimoGraphMetrics(null, 0, 0, 0, 0, 0, 0);
var graph_click = {"start": 0, "stop": 0};
var zooms = [];

var sort_table = {
  "motif": [
    {"name": "<i>E</i>-value", "fn": sort_motif_evalue, "priority": 1, "pair": "evalue"},
    {"name": "Fisher <i>E</i>-value", "fn": sort_motif_fisherpv, "priority": 2, 
      "show": data['options']['neg_sequences'], "pair": "fisherpv"},
    {"name": "Concentration", "fn": sort_motif_concentration, "pair": "evalue"},
    {"name": "Region Position", "fn": sort_motif_position, "pair": "position"},
    {"name": "Region Distance", "fn": sort_motif_center, "pair": "center"},
    {"name": "Region Width", "fn": sort_motif_spread, "pair": "spread"},
    {"name": "Region Matches", "fn": sort_motif_sites, "pair": "sites"},
    {"name": "<i>p</i>-value (Neg Data)", "fn": sort_motif_neg_pvalue,
      "show": data['options']['neg_sequences'], "pair": "neg_pvalue"},
    {"name": "Region Matches in (Neg Data)", "fn": sort_motif_neg_sites, 
      "show": data['options']['neg_sequences'], "pair": "neg_sites"},
    {"name": "Matthew's Correlation Coefficient", "fn": sort_motif_mcc, 
      "show": data['options']['mcc'], "pair": "mcc"},
    {"name": "Sequence Matches", "fn": sort_motif_total_sites, "pair": "evalue"},
    {"name": "Max Probability", "fn": sort_motif_max_probability, "pair": "evalue"},
    {"name": "ID", "fn": sort_motif_id, "pair": "evalue"},
    {"name": "Alt ID", "fn": sort_motif_alt, "pair": "evalue"},
    {"name": "Consensus", "fn": sort_motif_consensus, "pair": "evalue"},
  ],
  "region": [
    {"id": "evalue", "name": "<i>E</i>-value", "fn": sort_peak_evalue,
      "priority": 1},
    {"id": "fisherpv", "name": "Fisher <i>E</i>-value", "fn": sort_peak_fisherpv,
      "priority": 2, "show": data['options']['neg_sequences']},
    {"id": "position", "name": "Region Position", "fn": sort_peak_position},
    {"id": "center", "name": "Region Distance", "fn": sort_peak_center},
    {"id": "spread", "name": "Region Width", "fn": sort_peak_spread},
    {"id": "sites", "name": "Region Matches", "fn": sort_peak_sites},
    {"id": "neg_pvalue", "name": "<i>p</i>-value (Neg Data)",
      "fn": sort_peak_neg_pvalue, "show": data['options']['neg_sequences']},
    {"id": "neg_sites", "name": "Region Matches in (Neg Data)",
      "fn": sort_peak_neg_sites, "show": data['options']['neg_sequences']},
    {"id": "mcc", "name": "Matthew's Correlation Coefficient",
      "fn": sort_peak_mcc, "show": data['options']['mcc']}
  ],
};

pre_load_setup();


/*
 * name_from_source
 *
 * Makes a file name more human friendly to read.
 */
function name_from_source(source) {
  "use strict";
  var file, noext;
  if (source == "-") {
    return "-"
  }
  //assume source is a file name
  file = source.replace(/^.*\/([^\/]+)$/,"$1");
  noext = file.replace(/\.[^\.]+$/, "");
  return noext.replace(/_/g, " ");
}

/*
 * get_central_probability
 *
*/
function get_central_probability() {
  var i, j;
  var windo = default_smoothing_window;
  if ($("windo"))  windo = parseInt($("windo").value);
  var half_windo = windo / 2;
  var motifs = data["motifs"];
  for (i = 0; i < motifs.length; i++) {
    var motif = motifs[i];
    var sites = motif["sites"];
    var sum = 0;
    var j1 = Math.round(-half_windo - ((motif["len"] / 2) - (data["seqlen"] / 2) + 0.5));
    var j2 = j1 + windo;
    for (j = j1; j <= j2; j++) sum += sites[j];
    motif["central_prob"] = sum / motif["total_sites"];
  }
} // get_central_probability

/*
 * pre_load_setup
 *
 *  Sets up initial variables which may be
 *  required for the HTML document creation.
 */
function pre_load_setup() {
  "use strict";
  var i, motifs, params, showlist, show, parts, db_i, id, j, motif;
  var seq_db, db, dbs, sites, max_site, max_site_pos;
  for (i = 0; i < palate.length -1; i++) {
    s_motifs[i] = null;
    s_swatches[i] = null;
    s_logos[i] = null;
  }
  s_count = 0;
  motifs = data["motifs"];
  if (data["options"]["disc"]) {
    motifs.sort(sort_motif_fisherpv);
  } else {
    motifs.sort(sort_motif_evalue);
  }
  // put a copy of the best evalue in the motif
  for (i = 0; i < motifs.length; i++) {
    motif = motifs[i];
    motif["best_log_adj_pvalue"] = motif["peaks"][0]["log_adj_pvalue"];
    // calculate the best probability
    max_site = 0;
    max_site_pos = 0;
    sites = motif["sites"];
    for (j = 0; j < sites.length; j++) {
      if (sites[j] > max_site) {
        max_site = sites[j];
        max_site_pos = j;
      }
    }
    motif["max_prob"] = max_site / motif["total_sites"];
    motif["max_prob_loc"] = max_site_pos + (motif["len"] / 2) - (data["seqlen"] / 2);
  }
  params = parse_params();
  if (params["show"]) {
    showlist = params["show"];
    for (i = 0; i < showlist.length; i++) {
      show = showlist[i];
      parts = show.match(/^db(\d+) (.+)$/);
      db_i = parseInt(parts[1]);
      id = parts[2];
      // loop over the motifs looking for a match
      for (j = 0; j < motifs.length; j++) {
        motif = motifs[j];
        if (motif["db"] == db_i && motif["id"] == id) {
          motif["colouri"] = s_count + 1;
          s_motifs[s_count] = motif;
          s_count++;
          break;
        }
      }
      // give up if we've used all the available colours
      if ((s_count + 1) >= palate.length) break; 
    }
  } else {
    s_count = Math.min(3, motifs.length);
    for (i = 0; i < s_count; i++) {
      motif = motifs[i];
      motif["colouri"] = i+1;
      s_motifs[i] = motif;
    }
  }
  calculate_seq_ids();
  // get the name of the sequence db
  seq_db = data['sequence_db'];
  if (!seq_db['name']) seq_db['name'] = name_from_source(seq_db['source']);
  // get the names of the motif databases
  dbs = data['motif_dbs'];
  for (i = 0; i < dbs.length; i++) {
    db = dbs[i];
    if (!db['name']) db['name'] = name_from_source(db['source']);
  }
}

function num_keys(e) {
  if (!e) var e = window.event;
  var code = (e.keyCode ? e.keyCode : e.which);
  var keychar = String.fromCharCode(code);
  var numre = /\d/;
  // only allow 0-9 and various control characters (Enter, backspace, delete)
  if (code != 8 && code != 9 && code != 13 && code != 46 && !numre.test(keychar)) {
    e.preventDefault();
  }
}

/*
 * toggle_column
 *
 * Adds or removes a class from the table displaying the 
 * centrally enriched motifs. This is primary used to set the visibility
 * of columns by using css rules. If the parameter 'show' is not passed
 * then the existence of the class will be toggled, otherwise it will be
 * included if show is false.
 */
function toggle_column(cls) {
  toggle_class($("motifs"), cls);
}

/*
 * toggle_filter
 *
 * Called when the user clicks a checkbox
 * to enable/disable a filter option.
 */
function toggle_filter(chkbox, filter_id) {
  var filter = $(filter_id);
  filter.disabled = !(chkbox.checked);
  if (!filter.disabled) {
    filter.focus();
    if (filter.select) filter.select();
  }
}

/*
 * enable_filter
 *
 * Called when the user clicks a filter label.
 * Enables the filter.
 */
function enable_filter(chkbox_id, filter_id) {
  var chkbox = $(chkbox_id);
  if (!chkbox.checked) {
    var filter = $(filter_id);
    $(chkbox_id).checked = true;
    filter.disabled = false;
    filter.focus();
    if (filter.select) filter.select();
  }
}

/*
 * update_filter
 *
 * If the key event is an enter key press then
 * update the filter on the CEM table
 */
function update_filter(e) {
  if (!e) var e = window.event;
  var code = (e.keyCode ? e.keyCode : e.which);
  if (code == 13) {
    e.preventDefault();
    make_CEM_table();
  }
}

/*
 * toggle_lock
 *
 */

/*
 * clear_selection
 *
 * Called when the user clicks the X in the
 * title of the centrally enriched motifs and
 * causes all the motifs to be deselected.
 */
function clear_selection() {
  for (var i = 1; i < palate.length; i++) {
    var motif = s_motifs[i-1];
    var swatch = s_swatches[i-1];
    s_motifs[i-1] = null;
    s_swatches[i-1] = null;
    s_logos[i-1] = null;
    if (motif) delete motif['colouri'];
    if (swatch) swatch.style.backgroundColor = palate[0];
  }
  s_count = 0;
  if (!data['options']['noseq']) {
    //reset_sequences_IDs_list();
    union_seq_ids = [];
    intersect_seq_ids = [];
    display_seq_ids();
  }
  make_PM_table();
  make_MP_graph();
}

/*
 * toggle_graph_motif
 *
 * Activated when the user clicks on a swatch in the centrally enriched motifs 
 * table. If the motif is already selected it deselects it otherwise it picks 
 * an unused colour and selects it for graphing.
 */
function toggle_graph_motif(e) {
  "use strict";
  var swatch;
  if (!e) var e = window.event;
  if (e.target) swatch = e.target;
  else if (e.srcElement) swatch = e.srcElement;
  // in case we land on a text node
  if (swatch.nodeType == 3) swatch = swatch.parentNode;
  // find the containing tbody
  var group = find_parent(swatch.parentNode, "peak_group");
  // get the attached motif
  var motif = group['data_motif'];
  if (motif['colouri'] && motif['colouri'] != 0) {
    // deselect the motif
    var i = motif['colouri'];
    s_motifs[i-1] = null;
    s_swatches[i-1] = null;
    s_logos[i-1] = null;
    delete motif['colouri'];
    swatch.style.backgroundColor = palate[0];
    s_count--;
    if (!data['options']['noseq']) calculate_seq_ids();
  } else {
    // select an unused colour
    var i;
    for (i = 1; i < palate.length; i++) {
      if (!s_motifs[i-1]) break;
    }
    if (i == palate.length) {
      alert("All graph colours used. Please deselect motifs before adding more.");
      return;
    }
    s_motifs[i-1] = motif;
    s_swatches[i-1] = swatch;
    motif['colouri'] = i;
    swatch.style.backgroundColor = palate[i];
    s_count++;
    if (!data['options']['noseq']) {
      if (s_count == 1) {
        union_seq_ids = motif["seqs"].slice(0);
        intersect_seq_ids = union_seq_ids.slice(0);
      } else {
        union_seq_ids = union_nums(union_seq_ids, motif["seqs"]);
        intersect_nums(intersect_seq_ids, motif["seqs"]);
      }
    }
  }
  if (!data['options']['noseq']) display_seq_ids();
  make_PM_table();
  make_MP_graph();
}

/*
 * move_legend
 *
 * Called when the user clicks on the graph
 * to move the legend location.
 */
function move_legend(e) {
  var target;
  if (!e) var e = window.event;
  if (e.target) target = e.target;
  else if (e.srcElement) target = e.srcElement;
  var elemXY = coords(target);
  var posx = 0;
  var posy = 0;
  if (e.pageX || e.pageY)   {
    posx = e.pageX;
    posy = e.pageY;
  }
  else if (e.clientX || e.clientY)   {
    posx = e.clientX + document.body.scrollLeft
      + document.documentElement.scrollLeft;
    posy = e.clientY + document.body.scrollTop
      + document.documentElement.scrollTop;
  }
  var x = posx - elemXY[0];
  var y = posy - elemXY[1];
  legend_x = x - graph_metrics.legend_width/2;
  legend_y = y - graph_metrics.legend_height/2;
  if (parseInt($("legend").value) != 0) make_MP_graph();
}

function highlight_peak(e) {
  var target, pop;
  pop = $("pop_peak");
  if (pop.style.visibility === "visible") return;
  if (!e) var e = window.event;
  if (e.target) target = e.target;
  else if (e.srcElement) target = e.srcElement;
  while (!target['data_peak']) {
    if (target.nodeName == 'BODY') return;
    target = target.parentNode;
  }
  var peak = target['data_peak'];

  var l = graph_metrics.left_mark;
  var w = graph_metrics.right_mark - graph_metrics.left_mark;
  var d = graph_metrics.right_val - graph_metrics.left_val;
  var unit = w / d;

  var peak_width = peak["spread"];
  var peak_left = peak["center"] - (peak["spread"] / 2);
  var peak_offscreen = 0;
  if (peak_left < graph_metrics.left_val) {
    peak_offscreen = graph_metrics.left_val - peak_left;
    peak_width = Math.max(0, peak_width - peak_offscreen);
    peak_left = graph_metrics.left_val;
  } else if ((peak_left + peak_width) > graph_metrics.right_val) {
    peak_offscreen = (peak_left + peak_width) - graph_metrics.right_val;
    peak_width = Math.max(0, peak_width - peak_offscreen);
    peak_left = Math.min(peak_left, graph_metrics.right_val);
  }
  
  if (peak_width > 0) {
    pop.style.width = (peak_width * unit) + "px";
    pop.style.left = (l + ((peak_left - graph_metrics.left_val) * unit)) + "px";
    pop.style.visibility = "visible";
  }
}

function dehighlight_peak(e) {
  $("pop_peak").style.visibility = "hidden";
}

/*
 * hover_logo
 *
 * Activated when the user hovers their cursor over a row in the centrally 
 * enriched motifs table. After a fifth of a second delay, displays a box with 
 * the logo and reverse complement logo.
 */
function hover_logo(e) {
  var popup;
  if (this === logo_row) return;
  logo_row = this;
  if (logo_timer) clearTimeout(logo_timer);
  logo_row.addEventListener('mousemove', move_logo, false);
  popup = $("logo_popup");
  if (popup["data_motif"] != logo_row["data_motif"]) {
    logo_timer = setTimeout(popup_logo, 200);
  } else {
    popup.style.display = "block";
  }
}

/*
 * dehover_logo
 *
 * Activated when the user moves their cursor off a row in the centrally 
 * enriched motifs table. Hides the logo box (or stops it from being displayed).
 */
function dehover_logo(e) {
  var popup = $("logo_popup");
  popup.style.display = "none";
  if (logo_timer) clearTimeout(logo_timer);
  if (logo_row) logo_row.removeEventListener('mousemove', move_logo, false);
  logo_row = null;
  logo_timer = null;
}

/*
 * move_logo
 * 
 * keeps the motif logo at a set distance from the cursor.
 */
function move_logo(e) {
  var popup = $("logo_popup");
  popup.style.left = (e.pageX + 20) + "px";
  popup.style.top = (e.pageY + 20) + "px";
}

/*
 * popup_logo
 *
 * Activated when the user has had the cursor over a row in the centrally 
 * enriched motifs table for longer than 1/5th of a second. It draws the
 * motif logos in a popup and displays the popup.
 */
function popup_logo() {
  if (logo_row == null) return;
  var motif = logo_row["data_motif"];
  var pspm = new Pspm(motif['pwm'], motif['id'], 0, 0, 
      motif['motif_nsites'], motif['motif_evalue']);
  var canvas = $("logo_popup_canvas");
  var logo = logo_1(alphabet, "", pspm);
  draw_logo_on_canvas(logo, canvas, false, 0.5);
  if (!data["options"]["norc"]) {
    // draw RC motif
    var canvas_rc = $("logo_popup_canvas_rc");
    var pspm_rc = pspm.copy().reverse_complement(alphabet);
    var logo_rc = logo_1(alphabet, "", pspm_rc);
    draw_logo_on_canvas(logo_rc, canvas_rc, false, 0.5);
  }

  var popup = $("logo_popup");
  popup.style.display = "block";
  popup['data_motif'] = motif;
  logo_timer = null;
}

/*
 * swap_colour
 *
 * Activated when the user clicks a swatch in the plotted motifs table.
 * If a swatch has already been selected then swap colours with this one,
 * otherwise record which swatch has been selected.
 */
function swap_colour(e) {
  var swatch;
  if (!e) var e = window.event;
  if (e.target) swatch = e.target;
  else if (e.srcElement) swatch = e.srcElement;
  var row = swatch;
  while (!row['motif']) row = row.parentNode;
  var motif = row['motif'];
  if (swap == null) {
    swatch.appendChild(document.createTextNode("\u21c5"));
    swap = motif;
  } else if (swap == motif) {
    while (swatch.firstChild) swatch.removeChild(swatch.firstChild);
    swap = null;
  } else {
    var swapi = swap['colouri'];
    var motifi = motif['colouri'];
    motif['colouri'] = swapi;
    swap['colouri'] = motifi;
    // swap swatches
    var temp = s_swatches[swapi-1];
    s_swatches[swapi-1] = s_swatches[motifi-1];
    s_swatches[motifi-1] = temp;
    // swap motifs
    temp = s_motifs[swapi-1];
    s_motifs[swapi-1] = s_motifs[motifi-1];
    s_motifs[motifi-1] = temp;
    // swap logos
    temp = s_logos[swapi-1];
    s_logos[swapi-1] = s_logos[motifi-1];
    s_logos[motifi-1] = temp;
    // update swatch colours
    s_swatches[swapi-1].style.backgroundColor = palate[swapi];
    s_swatches[motifi-1].style.backgroundColor = palate[motifi];
    swap = null;
    make_PM_table();
    make_MP_graph();
  }
}

/*
 * set_colour
 *
 * Activated when the user clicks a swatch in the unused colours section.
 * If a swatch has already been selected then set its colour to this one,
 * otherwise warn the user that they must select a motif swatch first.
 */
function set_colour(e) {
  var swatch;
  if (!e) var e = window.event;
  if (e.target) swatch = e.target;
  else if (e.srcElement) swatch = e.srcElement;
  var colouri = swatch['colouri'];
  if (swap) {
    var swapi = swap['colouri'];
    swap['colouri'] = colouri;
    s_swatches[colouri-1] = s_swatches[swapi-1];
    s_motifs[colouri-1] = s_motifs[swapi-1];
    s_logos[colouri-1] = s_logos[swapi-1];
    s_swatches[swapi-1] = null;
    s_motifs[swapi-1] = null;
    s_logos[swapi-1] = null;
    s_swatches[colouri-1].style.backgroundColor = palate[colouri];
    swap = null;
    make_PM_table();
    make_MP_graph();
  } else {
    alert("You must select a motif to set to this colour first.");
  }
}

/*
 * page_loaded
 *
 * Called when the page has loaded for the first time.
 */
function page_loaded() {
  first_load_setup();
  post_load_setup();
}

/*
 * page_loaded
 *
 * Called when a cached page is reshown.
 */
function page_shown(e) {
  if (e.persisted) post_load_setup();
}

/*
 * union_nums
 *
 * Returns a union of two sorted lists of numbers.
 */
function union_nums(list1, list2) {
  "use strict";
  var i, j, list_out;
  i = j = 0;
  list_out = [];
  while (i < list1.length && j < list2.length) {
    if (list1[i] < list2[j]) {
      list_out.push(list1[i]);
      i++;
    } else if (list1[i] === list2[j]) {
      list_out.push(list1[i]);
      i++;
      j++;
    } else { // list1[i] > list2[j]
      list_out.push(list2[j]);
      j++;
    }
  }
  if (i < list1.length) {
    for (; i < list1.length; i++) {
      list_out.push(list1[i]);
    }
  } else {
    for (; j < list2.length; j++) {
      list_out.push(list2[j]);
    }
  }
  return list_out;
}

/*
 * intersect_nums
 *
 * Removes numbers from the target_list which do not also appear in the
 * incoming_list. Both lists must be sorted.
 */
function intersect_nums(target_list, incoming_list) {
  "use strict";
  var i, j, shift;
  shift = i = j = 0;
  while (i < target_list.length && j < incoming_list.length) {
    if (target_list[i] > incoming_list[j]) {
      j++;
    } else if (target_list[i] < incoming_list[j]) {
      i++;
      shift++;
    } else {
      if (shift > 0) target_list[i - shift] = target_list[i];
      i++;
      j++;
    }
  }
  target_list.length = i - shift;
}

function calculate_seq_ids() {
  var i, motif;
  // calculate sequence id sets
  if (!data['options']['noseq']) {
    if (s_count == 0) {
      union_seq_ids = [];
      intersect_seq_ids = [];
    } else {
      for (i = 0; i < s_motifs.length; i++) {
        motif = s_motifs[i];
        if (motif) {
          union_seq_ids = motif["seqs"].slice(0);
          intersect_seq_ids = union_seq_ids.slice(0);
          break;
        }
      }
      for (; i < s_motifs.length; i++) {
        motif = s_motifs[i];
        if (motif === null) continue;
        union_seq_ids = union_nums(union_seq_ids, motif["seqs"]);
        intersect_nums(intersect_seq_ids, motif["seqs"]);
      }
    }
  }
}

function display_seq_ids() {
  var u_n_cont, u_p_cont, i_n_cont, i_p_cont, i_s_cont;
  var union_count, intersect_count, total_count;
  var union_percent, intersect_percent, intersect_seqs, i;
  var sequences;
  sequences = data["sequences"];
  union_count = union_seq_ids.length;
  intersect_count = intersect_seq_ids.length;
  total_count = sequences.length;
  union_percent = Math.round((union_count / total_count) * 100);
  intersect_percent = Math.round((intersect_count / total_count) * 100);
  u_n_cont = $('matching_union_number');
  u_p_cont = $('matching_union_percentage');
  i_n_cont = $('matching_intersection_number');
  i_p_cont = $('matching_intersection_percentage');
  i_s_cont = $('matching_intersection_sequences');
  u_n_cont.innerHTML = "";
  u_n_cont.appendChild(document.createTextNode(union_count));
  u_p_cont.innerHTML = "";
  u_p_cont.appendChild(document.createTextNode(union_percent));
  i_n_cont.innerHTML = "";
  i_n_cont.appendChild(document.createTextNode(intersect_count));
  i_p_cont.innerHTML = "";
  i_p_cont.appendChild(document.createTextNode(intersect_percent));
  intersect_seqs = [];
  for (i = 0; i < intersect_count; i++) {
    intersect_seqs.push(sequences[intersect_seq_ids[i]]);
  }
  i_s_cont.value = intersect_seqs.join("\n");
}

/*
 * find_highest_peaks
 *
 * Locate highest peaks for every motif.
 * Compute every x position and keep the highest one.
 */
/*
function find_highest_peaks(smoothing_type) {
  var sequence_length=data['seqlen'];
  var windo=parseInt($("windo").value);
  var half_window = windo / 2;
  var weights = [];
  var tbl = $("motifs");
  var tbody = tbl.tBodies[0];
  if (smoothing_type==1) { // Only computed for weighted moving average
    var total_weight = 0;
    for (var i = 0; i < windo; i++) {
      var pos = i + 0.5;
      var weight = (pos < half_window ? pos / half_window : (windo - pos) / half_window);
      weights.push(weight);
      total_weight += weight;
    }
  }
  for (var i = 0; i < data['motifs'].length; i++) { // For each motif
    var motif = data['motifs'][i];
    var sites = motif['sites'];
    var max_prob=-1;
    var index_max_prob=-1;
    var xpos = (motif.len / 2) - (sequence_length / 2) + half_window;
    var end = sites.length - windo;
    for (var j = 0; j < end; j++, xpos += 1) {
      var sum = 0;
      for (var k = 0; k < windo; k++) {
        sum += (smoothing_type==1) ? sites[j + k] * weights[k] : sites[j + k];
      }
      var avg = (smoothing_type==1) ? sum / total_weight : sum / windo;
      var prob = avg / motif['total_sites'];
      if (prob>max_prob) { // If Y axis value is higher than saved one
        max_prob=prob; // Save it
        index_max_prob=Math.floor(xpos); // Save the location
      }
    }
    motif["highest_peak"]=index_max_prob; // Save highest peak location for this motif
  }
}*/

/*
 * first_load_setup
 *
 * Setup state that is dependent on everything having been loaded already.
 * On browsers which cache state this is only run once.
 */
function first_load_setup() {
  if (data['options']['noseq']) {
    // no sequence ids to display
    $('seq_area').style.display='none';
  }
  if (!data['options']['local']) {
    // bins are centered, there is only one peak
    $('show_blocation').checked = false;
    $('CB_show_blocation').style.display='none';
    $('box_peak_sort').style.display = 'none';
    toggle_class($('motifs'), 'hide_OEbins', true);
  }
  if (!data['options']['neg_sequences']) {
    $('show_fisherpv').checked = false;
    $('show_negtsites').checked = false;
    $('show_negbsites').checked = false;
    $('show_negative_binomial').checked = false;
    // no negative sites, so hide negative bin sites and total
    $('CB_show_plot_negative').style.display= 'none';
    $('plot_negative').value = 0;
    $('CB_show_negbsites').style.display= 'none';
    $('CB_show_negtsites').style.display= 'none';
    $('CB_show_negative_binomial').style.display='none';
    $('CB_filter_on_negbintest').style.display='none';
    $('cb_show_fisherpv').style.display = 'none';
    $('cb_filter_on_fisherpv').style.display = 'none';
  }
  if (!data['options']['disc']) {
    // negative data set was not used with a discriminative search
    $('cb_show_fisherpv').style.display = 'none';
  }
  if (!data['options']['mcc']) {
    $('CB_show_MCC').style.display='none';
  }
  if (!data['options']['optimize_score']) {
    // per motif score optimisation turned off, so hide column
    $('show_score').checked = false;
  }
  if (data['options']['dist']) {
    // distance-to-center objective so hide Region Matches and show total matches.
    $('show_bsites').checked = false;
    $('show_tsites').checked = true;
  }
}

/*
 * post_load_setup
 *
 * Setup state that is dependent on everything having been loaded already.
 */
function post_load_setup() {
  "use strict";
  var tbl, i;
  if (data["options"]["norc"]) $("logo_popup_canvas_rc").style.display = "none";
  $("filter_id").disabled = !($("filter_on_id").checked);
  $("filter_alt").disabled = !($("filter_on_alt").checked);
  $("filter_evalue").disabled = !($("filter_on_evalue").checked);
  $("filter_binwidth").disabled = !($("filter_on_binwidth").checked);
  $("filter_negbintest").disabled = !($("filter_on_negbintest").checked);
  tbl = $("motifs");
  toggle_class(tbl, "hide_db", !$("show_db").checked);
  toggle_class(tbl, "hide_id", !$("show_id").checked);
  toggle_class(tbl, "hide_name", !$("show_name").checked);
  toggle_class(tbl, "hide_consensus", !$("show_consensus").checked);
  toggle_class(tbl, "hide_fisherpv", !$("show_fisherpv").checked);
  toggle_class(tbl, "hide_evalue", !$("show_evalue").checked);
  toggle_class(tbl, "hide_pvalue", !$("show_pvalue").checked);
  toggle_class(tbl, "hide_MCC", !$("show_MCC").checked);
  toggle_class(tbl, "hide_blocation", !$("show_blocation").checked);
  toggle_class(tbl, "hide_bwidth", !$("show_bwidth").checked);
  toggle_class(tbl, "hide_bsites", !$("show_bsites").checked);
  toggle_class(tbl, "hide_tsites", !$("show_tsites").checked);
  toggle_class(tbl, "hide_negbsites", !$("show_negbsites").checked);
  toggle_class(tbl, "hide_negtsites", !$("show_negtsites").checked);
  toggle_class(tbl, "hide_negative_binomial", !$("show_negative_binomial").checked);
  toggle_class(tbl, "hide_maxprob", !$("show_maxprob").checked);
  toggle_class(tbl, "hide_hpeak", !$("show_hpeak").checked); //max prob location
  toggle_class(tbl, "hide_nbinstested", !$("show_nbinstested").checked);
  toggle_class(tbl, "hide_score", !$("show_score").checked);
  get_central_probability();
  make_PM_table();
  make_CEM_table();
  make_MP_graph();
  add_MP_graph_listeners();
  if (!data['options']['noseq']) display_seq_ids();
}

/*
 *  sort_motif_id
 *
 *  Takes 2 motif objects and compares them based on id and database.
 */
function sort_motif_id(m1, m2) {
  var diff;
  diff = m1['id'].localeCompare(m2['id']);
  if (diff == 0) {
    diff = m1['db'] - m2['db'];
  }
  return diff;
}

/*
 * sort_motif_alt
 *
 * Takes 2 motif objects and compares them based on alternate id.
 */
function sort_motif_alt(m1, m2) {
  var diff;
  if (m1['alt'] && m2['alt']) {
    diff = m1['alt'].localeCompare(m2['alt']);
    if (diff != 0) return diff;
    return sort_motif_evalue(m1, m2);
  } else {
    if (m1['alt']) {
      return -1;
    } else {
      return 1;
    }
  }
}

/*
 * sort_motif_consensus
 *
 * Takes 2 motif objects and compares them based on consensus.
 */
function sort_motif_consensus(m1, m2) {
  var diff;
  if (m1['consensus'] && m2['consensus']) {
    diff = m1['consensus'].localeCompare(m2['consensus']);
    if (diff != 0) return diff;
    return sort_motif_evalue(m1, m2);
  } else {
    if (m1['consensus']) {
      return -1;
    } else {
      return 1;
    }
  }
}

/*
 * sort_motif_fisherpv
 *
 * Takes 2 motif objects and compares them based on the Fisher pvalue
 */
function sort_motif_fisherpv(m1, m2) {
  var diff, p1, p2;
  p1 = m1['peaks'][0];
  p2 = m2['peaks'][0];
  diff = p1['fisher_log_adj_pvalue'] - p2['fisher_log_adj_pvalue'];
  if (diff != 0) return diff;
  diff = p2['pos_sites'] - p1['pos_sites'];
  if (diff != 0) return diff;
  return sort_motif_evalue(m1, m2);
}

function sort_motif_neg_pvalue(m1, m2) {
  var diff, p1, p2;
  //return sort_motif_evalue(m1, m2);
  p1 = m1['peaks'][0];
  p2 = m2['peaks'][0];
  diff = p1['neg_log_adj_pvalue'] - p2['neg_log_adj_pvalue'];
  if (diff != 0) return diff;
  diff = p2['neg_sites'] - p1['neg_sites'];
  if (diff != 0) return diff;
  return sort_motif_evalue(m1, m2);
}

function sort_motif_neg_sites(m1, m2) {
  var diff, p1, p2;
  p1 = m1['peaks'][0];
  p2 = m2['peaks'][0];
  diff = p1['neg_sites'] - p2['neg_sites'];
  if (diff != 0) return diff;
  diff = p1['neg_log_adj_pvalue'] - p2['neg_log_adj_pvalue'];
  if (diff != 0) return diff;
  return sort_motif_evalue(m1, m2);
}

/*
 * sort_motif_evalue
 *
 * Takes 2 motif objects and compares them based on the log_adj_pvalue.
 */
function sort_motif_evalue(m1, m2) {
  var diff, p1, p2;
  p1 = m1['peaks'][0];
  p2 = m2['peaks'][0];
  diff = p1['log_adj_pvalue'] - p2['log_adj_pvalue'];
  if (diff != 0) return diff;
  diff = p1['spread'] - p2['spread'];
  if (diff != 0) return diff;
  return sort_motif_id(m1, m2);
}

/*
 * sort_motif_spread
 *
 * Takes 2 motif objects and compares them based on the bin_width.
 */
function sort_motif_spread(m1, m2) {
  var diff, p2, p2;
  p1 = m1['peaks'][0];
  p2 = m2['peaks'][0];
  diff = p1['spread'] - p2['spread'];
  if (diff != 0) return diff;
  diff = p1['log_adj_pvalue'] - p2['log_adj_pvalue'];
  if (diff != 0) return diff;
  return sort_motif_id(m1, m2);
}

/*
 * sort_central_probability
 *
 * Takes 2 motif objects and compares them based on the concentration
 * of sites in the central region of width equal to the smoothing
 * window width.
 */
function sort_motif_concentration(m1, m2) {
  var diff;
  diff = m2['central_prob'] - m1['central_prob'];
  if (diff != 0) return diff;
  return sort_motif_evalue(m1, m2);
}

/*
 * sort_motif_max_probability
 *
 * Takes 2 motif objects and compares them based on the maximum probability.
 */
function sort_motif_max_probability(m1, m2) {
  var diff;
  diff = m2['max_prob'] - m1['max_prob'];
  if (diff != 0) return diff;
  return sort_motif_evalue(m1, m2);
}

/*
 * sort_motif_sites
 *
 * Takes 2 motif objects and compares them based on the bin sites.
 */
function sort_motif_sites(m1, m2) {
  var diff, p1, p2;
  p1 = m1['peaks'][0];
  p2 = m2['peaks'][0];
  diff = p2['sites'] - p1['sites'];
  if (diff != 0) return diff;
  return sort_motif_evalue(m1, m2);
}

/*
 * sort_motif_center
 *
 * Takes 2 motif objects and compares them based on the abs(bin location).
 */
function sort_motif_center(m1, m2) {
  var diff, p1, p2;
  p1 = m1['peaks'][0];
  p2 = m2['peaks'][0];
  diff = Math.abs(p1['center']) - Math.abs(p2['center']);
  if (diff != 0) return diff;
  diff = p1['center'] - p2['center'];
  if (diff != 0) return diff;
  return sort_motif_evalue(m1, m2);
}

/*
 * sort_motif_position
 *
 * Takes 2 motif objects and compares them based on the bin location.
 */
function sort_motif_position(m1, m2) {
  var diff, p1, p2;
  p1 = m1['peaks'][0];
  p2 = m2['peaks'][0];
  diff = p1['center'] - p2['center'];
  if (diff != 0) return diff;
  return sort_motif_evalue(m1, m2);
}

/*
 * sort_motif_mcc
 *
 * Takes 2 motif objects and compares them based on the Matthews Correlation Coefficient.
 */
function sort_motif_mcc(m1, m2) {
  var diff, p1, p2;
  p1 = m1['peaks'][0];
  p2 = m2['peaks'][0];
  diff = p2['mcc'] - p1['mcc'];
  if (diff != 0) return diff;
  return sort_motif_evalue(m1, m2);
}

/*
 * sort_motif_total_sites
 *
 * Takes 2 motif objects and compares them based on the total sites.
 */
function sort_motif_total_sites(m1, m2) {
  var diff;
  diff = m2['total_sites'] - m1['total_sites'];
  if (diff != 0) return diff;
  return sort_motif_evalue(m1, m2);
}


/*
 * get_sort_cmp
 *
 * Gets the sorting comparator by index.
 *
 */
function motif_sort_cmp(index) {
  "use strict";
  if (index > 0 && index < sort_table["motif"].length) {
    return sort_table["motif"][index]["fn"];
  }
  return sort_motif_evalue;
}

/*
 * sort_peak_fisherpv
 *
 * Takes 2 peak objects and compares them based on the Fisher pvalue
 */
function sort_peak_fisherpv(p1, p2) {
  var diff;
  if (p1['filtered'] != p2['filtered']) return (p1['filtered'] ? 1 : -1);
  diff = p1['fisher_log_adj_pvalue'] - p2['fisher_log_adj_pvalue'];
  if (diff != 0) return diff;
  diff = p2['pos_sites'] - p1['pos_sites'];
  if (diff != 0) return diff;
  return sort_peak_evalue(p1, p2);
}

function sort_peak_evalue(p1, p2) {
  var diff;
  if (p1['filtered'] != p2['filtered']) return (p1['filtered'] ? 1 : -1);
  diff = p1['log_adj_pvalue'] - p2['log_adj_pvalue'];
  if (diff != 0) return diff;
  diff = p1['spread'] - p2['spread'];
  if (diff != 0) return diff;
  return p1['center'] - p2['center']; 
}

function sort_peak_mcc(p1, p2) {
  var diff;
  if (p1['filtered'] != p2['filtered']) return (p1['filtered'] ? 1 : -1);
  diff = p2['mcc'] - p1['mcc'];
  if (diff != 0) return diff;
  return sort_peak_evalue(p1, p2);
}

function sort_peak_center(p1, p2) {
  if (p1['filtered'] != p2['filtered']) return (p1['filtered'] ? 1 : -1);
  diff = Math.abs(p1['center']) - Math.abs(p2['center']); 
  if (diff != 0) return diff;
  return p1['center'] - p2['center']; 
}

function sort_peak_position(p1, p2) {
  if (p1['filtered'] != p2['filtered']) return (p1['filtered'] ? 1 : -1);
  return p1['center'] - p2['center']; 
}

function sort_peak_spread(p1, p2) {
  var diff;
  if (p1['filtered'] != p2['filtered']) return (p1['filtered'] ? 1 : -1);
  diff = p1['spread'] - p2['spread'];
  if (diff != 0) return diff;
  diff = p1['log_adj_pvalue'] - p2['log_adj_pvalue'];
  if (diff != 0) return diff;
  return p1['center'] - p2['center']; 
}

function sort_peak_sites(p1, p2) {
  var diff;
  if (p1['filtered'] != p2['filtered']) return (p1['filtered'] ? 1 : -1);
  diff = p2['sites'] - p1['sites'];
  if (diff != 0) return diff;
  return sort_peak_evalue(p1, p2);
}

function sort_peak_neg_pvalue(p1, p2) {
  var diff;
  if (p1['filtered'] != p2['filtered']) return (p1['filtered'] ? 1 : -1);
  diff = p1['neg_log_adj_pvalue'] - p2['neg_log_adj_pvalue'];
  if (diff != 0) return diff;
  diff = p2['neg_sites'] - p1['neg_sites'];
  if (diff != 0) return diff;
  return sort_peak_evalue(p1, p2);
}

function sort_peak_neg_sites(p1, p2) {
  var diff;
  if (p1['filtered'] != p2['filtered']) return (p1['filtered'] ? 1 : -1);
  diff = p1['neg_sites'] - p2['neg_sites'];
  if (diff != 0) return diff;
  diff = p1['neg_log_adj_pvalue'] - p2['neg_log_adj_pvalue'];
  if (diff != 0) return diff;
  return sort_peak_evalue(p1, p2);
}

function peak_sort_cmp(index) {
  "use strict";
  if (index > 0 && index < sort_table["region"].length) {
    return sort_table["region"][index]["fn"];
  }
  return sort_peak_evalue;
}

/*
 * log2str
 *
 * Converts a log value into scientific notation.
 */
function log2str(log_val, precision, max) {
  var log10_val, e, m;
  if (log_val < 0) {
    log10_val = log_val / Math.log(10);
    e = Math.floor(log10_val);
    m = Math.pow(10, log10_val - e);
    if (m + (0.5 * Math.pow(10, -precision)) >= 10) {
      m = 1;
      e += 1;
    }
    return "" + m.toFixed(precision) + "e" + e;
  } else if (typeof max !== "number" || Math.exp(log_val) < max) {
    return Math.exp(log_val).toFixed(precision);
  } else {
    return ">"+max;
  }
}

/*
 * str2log
 *
 * Converts a scientific notation number string to a log value.
 */
function str2log(str, default_value) {
  var sci_num_re, parts, m, e, log_num;
  if (typeof default_value === "undefined") {
    default_value = null;
  }
  sci_num_re = /^([+]?\d+(?:\.\d+)?)(?:[eE]([+-]\d+))?$/;
  parts = sci_num_re.exec(str);
  if (parts && parseFloat(parts[1]) != 0) {
    m = parseFloat(parts[1]);
    if (m === 0) return default_value;
    e = (parts.length == 3 && parts[2] != null ? parseInt(parts[2]) : 0);
    log_num = (((Math.log(m)/Math.log(10)) + e) * Math.log(10));
    return log_num;
  } else {
    return default_value;
  }
}

/*
 * pvstr
 *
 * Gets the p-value of the motif in string form.
 */
function pvstr(peak) {
  return log2str(peak['log_adj_pvalue'], 1);
}

/*
 * evstr
 *
 * Gets the E-value of the motif in string form.
 */
function evstr(peak, type) {
  return log2str(peak[type] + Math.log(data['tested']), 1);
}

/*
 * make_swatch
 *
 * Make a swatch block.
 */
function make_swatch(colouri) {
  var swatch = document.createElement('div');
  swatch.className = 'swatch';
  swatch.style.backgroundColor = palate[colouri];
  swatch.style.color = text_palate[colouri];
  return swatch;
}

function make_CEM_main_row(tbody, motif) {
  "use strict";
  var colouri, row, swatch, peak, expander;
  peak = motif['peaks'][0];
  colouri = motif['colouri'];
  if (!colouri) colouri = 0;
  row = tbody.insertRow(tbody.rows.length);
  row['data_peak'] = peak;
  swatch = make_swatch(colouri);
  swatch.onclick = toggle_graph_motif;
  if (colouri != 0) {
    s_swatches[colouri -1] = swatch;
  }
  add_cell(row, swatch);
  add_text_cell(row, motif_dbs[motif['db']]['name'], 'col_db');
  add_cell(row, make_link(motif['id'], motif['url']), 'col_id');
  add_text_cell(row, motif['alt'], "col_name");
  add_text_cell(row, motif['consensus'], "col_consensus");
  add_text_cell(row, motif["central_prob"].toFixed(4), "col_centralprob");
  add_text_cell(row, evstr(peak, 'log_adj_pvalue'), 'col_evalue');
  if (data['options']['neg_sequences']) {
    add_text_cell(row, evstr(peak, 'fisher_log_adj_pvalue'), "col_fisherpv");
  }
  add_text_cell(row, pvstr(peak), 'col_pvalue');
  if (data['options']['neg_sequences']) {
    add_text_cell(row, log2str(peak['neg_log_adj_pvalue'],1), "col_negative_binomial");
  } else {
    add_text_cell(row, '', "col_negative_binomial");
  }
  if (data['options']['mcc']) {
    add_text_cell(row, peak['mcc'].toFixed(3), "col_MCC");
  } else {
    add_text_cell(row, '', "col_MCC");
  }
  add_text_cell(row, peak['center'], "col_blocation");
  add_text_cell(row, peak['spread'], 'col_bwidth');
  add_text_cell(row, Math.round(peak['sites']), "col_bsites");
  add_text_cell(row, motif['total_sites'], "col_tsites");
  if (data['options']['neg_sequences']) {
    add_text_cell(row, Math.round(peak['neg_sites']), "col_negbsites");
    add_text_cell(row, motif['neg_total_sites'], "col_negtsites");
  } else {
    add_text_cell(row, '', "col_negbsites")
    add_text_cell(row, '', "col_negtsites");
  }
  add_text_cell(row, motif["max_prob"].toFixed(4), "col_maxprob");
  add_text_cell(row, motif["max_prob_loc"], "col_problocation");
  add_text_cell(row, motif['n_tested'], "col_nbinstested");
  add_text_cell(row, motif['score_threshold'].toExponential(2), "col_score");
  if (motif['peaks'].length > 1) {
    expander = document.createElement('span');
    expander.appendChild(document.createTextNode("\u21A7"));
    expander.className = "expander";
    expander.addEventListener("click", toggle_peaks, false);
    add_cell(row, expander, "col_OEbins");
  } else {
    add_text_cell(row, '-', "col_OEbins");
  }
  row.addEventListener('mouseover', highlight_peak, false);
  row.addEventListener('mouseout', dehighlight_peak, false);
}

function make_CEM_sub_row(tbody, peak) {
  var row = tbody.insertRow(tbody.rows.length);
  row['data_peak'] = peak;
  row.className = "sub_peak";
  add_text_cell(row,'\u2022', 'no_swatch');
  add_text_cell(row, '', 'col_db');
  add_text_cell(row, '', 'col_id');
  add_text_cell(row, '', 'col_name');
  add_text_cell(row, evstr(peak, 'log_adj_pvalue'), 'col_evalue');
  if (data['options']['neg_sequences']) {
    add_text_cell(row, evstr(peak, 'fisher_log_adj_pvalue'), "col_fisherpv");
  }
  add_text_cell(row, pvstr(peak), 'col_pvalue');
  if (data['options']['neg_sequences']) {
    add_text_cell(row, log2str(peak['neg_log_adj_pvalue'],1), "col_negative_binomial");
  } else {
    add_text_cell(row, '', "col_negative_binomial");
  }
  if (data['options']['mcc']) {
    add_text_cell(row, peak['mcc'].toFixed(3), "col_MCC");
  } else {
    add_text_cell(row, '', "col_MCC");
  }
  add_text_cell(row, peak['center'], "col_blocation");
  add_text_cell(row, peak['spread'], 'col_bwidth');
  add_text_cell(row, Math.round(peak['sites']), "col_bsites");
  add_text_cell(row, '', "col_tsites");
  if (data['options']['neg_sequences']) {
    add_text_cell(row, Math.round(peak['neg_sites']), "col_negbsites");
  } else {
    add_text_cell(row, '', "col_negbsites")
  }
  add_text_cell(row, '', "col_negtsites");
  add_text_cell(row, '', "col_maxprob");
  add_text_cell(row, '', "col_problocation");
  add_text_cell(row, '', "col_nbinstested");
  add_text_cell(row, '', "col_score");
  add_text_cell(row, '', "col_OEbins");
  row.addEventListener('mouseover', highlight_peak, false);
  row.addEventListener('mouseout', dehighlight_peak, false);
}

function make_CEM_skip_row(tbody, n_skipped) {
  var row, cell, desc;
  if (n_skipped === 0) return;
  row = tbody.insertRow(tbody.rows.length);
  row.className = "sub_peak";

  if (n_skipped === 1) {
    desc = "1 peak hidden due to filters";
  } else {
    desc = n_skipped + " peaks hidden due to filters";
  }

  cell = row.insertCell(row.cells.length);
  cell.colSpan = 19;
  cell.style.textAlign = "center";
  cell.style.fontWeight = "bold";
  cell.appendChild(document.createTextNode(desc));
}

/*
 * make_CEM_table
 *
 * Generate the table which lists centrally enriched motifs.
 */
function make_CEM_table() {
  var motif_sort, peak_sort;
  var filter, motifs, filtered, motif, peaks, motif_dbs;
  var tbl, tbody, row, cell, i, j, skipped;
  // get the filter and sort comparator
  motif_sort = motif_sort_cmp(parseInt($('motif_sort').value));
  peak_sort = peak_sort_cmp(parseInt($('peak_sort').value));
  filter = get_filter();

  motifs = data['motifs'];
  // sort the motif peaks
  for (i = 0; i < motifs.length; i++) {
    motif = motifs[i];
    peaks = motif['peaks'];
    for (j = 0; j < peaks.length; j++) {
      peaks[j]["filtered"] = filter_peak(filter, peaks[j]);
    }
    peaks.sort(peak_sort);
  }
  // filter the motifs
  filtered = [];
  for (i = 0; i < motifs.length; i++) {
    if (filter_motif(filter, motifs[i])) continue;
    if (motifs[i]["peaks"][0]["filtered"]) continue;
    filtered.push(motifs[i]);
  }
  // sort
  filtered.sort(motif_sort);
  // limit
  if (filter["on_count"]) {
    if (filtered.length > filter["count"]) filtered.length = filter["count"];
  }
  // re-add any omitted s_motifs motifs
  outer_loop:
  for (i = 0; i < s_motifs.length; i++) {
    if (s_motifs[i] == null) continue;
    for (j =0; j < filtered.length; j++) {
      if (filtered[j] === s_motifs[i]) {
        continue outer_loop;
      }
    }
    filtered.push(s_motifs[i]);
  }
  // sort again
  filtered.sort(motif_sort);

  // clear the table
  tbl = $("motifs");
  for (i = tbl.tBodies.length - 1; i >= 0; i--) {
    tbody = tbl.tBodies[i];
    tbody.parentNode.removeChild(tbody);
  }

  motif_dbs = data['motif_dbs'];
  // add the new rows to the table
  for (i = 0; i < filtered.length; i++) {
    motif = filtered[i];
    peaks = motif['peaks'];
    tbody = document.createElement('tbody');
    tbody.className = "peak_group";
    tbody["data_motif"] = motif;
    tbody.addEventListener('mouseover', hover_logo, false);
    tbody.addEventListener('mouseout', dehover_logo, false);
    make_CEM_main_row(tbody, motif);
    skipped = 0;
    for (j = 1; j < peaks.length; j++) {
      if (filter_peak(filter, peaks[j])) {
        skipped++;
        continue;
      }
      make_CEM_sub_row(tbody, peaks[j]);
    }
    make_CEM_skip_row(tbody, skipped);
    tbl.appendChild(tbody);
  }
  // note the count of filtered motifs
  if (filtered.length != motifs.length) {
    skipped =  motifs.length - filtered.length;
    tbody = document.createElement('tbody');
    row = tbody.insertRow(tbody.rows.length);

    if (skipped === 1) {
      desc = "1 motif hidden due to filters";
    } else {
      desc = skipped + " motifs hidden due to filters";
    }
    cell = row.insertCell(row.cells.length);
    cell.colSpan = 19;
    cell.style.textAlign = "center";
    cell.style.fontWeight = "bold";
    cell.appendChild(document.createTextNode(desc));
    tbl.appendChild(tbody);
  }
}

function get_filter() {
  var filter, id_pat, alt_pat, alt_re, log_evalue_max, spread, count;
  var neg_log_pvalue_min;
  filter = {};
  // get the db filter
  filter["on_db"] = $("filter_on_db").checked;
  filter["db"] = $("filter_db").value;
  // get the id filter
  filter["on_id"] = $("filter_on_id").checked;
  id_pat = $("filter_id").value;
  try {
    filter["id"] = new RegExp(id_pat, "i");
    $("filter_id").className = "";
  } catch (err) {
    $("filter_id").className = "error";
    filter["on_id"] = false;
  }
  // get the name filter
  filter["on_alt"] = $("filter_on_alt").checked;
  alt_pat = $("filter_alt").value;
  try {
    filter["alt"] = new RegExp(alt_pat, "i");
    $("filter_alt").className = "";
  } catch (err) {
    filter["on_alt"] = false;
    $("filter_alt").className = "error";
  }
  // get the evalue filter
  filter["on_pvalue"] = $("filter_on_evalue").checked;
  if ((log_evalue_max = str2log($("filter_evalue").value)) != null) {
    filter["log_pvalue"] = log_evalue_max - Math.log(data['tested']);
    $("filter_evalue").className = "";
  } else {
    filter["on_pvalue"] = false;
    $("filter_evalue").className = "error";
  }
  // get the Fisher pv filter
  filter["on_fisherpv"] = $("filter_on_fisherpv").checked;
  if ((log_fisherpv_max = str2log($("filter_fisherpv").value)) != null) {
    filter["log_fisherpv"] = log_fisherpv_max - Math.log(data['tested']);
    $("filter_fisherpv").className = "";
  } else {
    filter["on_fisherpv"] = false;
    $("filter_fisherpv").className = "error";
  }
  // get the spread filter
  filter["on_spread"] = $("filter_on_binwidth").checked;
  spread = parseInt($("filter_binwidth").value);
  if (isNaN(spread) || spread < 1) {
    filter["on_spread"] = false;
    $("filter_binwidth").className = "error";
  } else {
    filter["spread"] = spread;
    $("filter_binwidth").className = "";
  }
  // get the negative binomial test filter
  filter["on_neg"] = data['options']['neg_sequences'] && $("filter_on_negbintest").checked;
  if ((neg_log_pvalue_min = str2log($("filter_negbintest").value)) != null) {
    $("filter_negbintest").className = "";
    filter["neg_log_pvalue"] = neg_log_pvalue_min - Math.log(data['tested']);
  } else {
    filter["on_neg"] = false;
    $("filter_negbintest").className = "error";
  }
  // get the motif count limit
  filter["on_count"] = $("filter_on_top").checked;
  count = parseInt($("filter_top").value);
  if (isNaN(count) || count < 1) {
    filter["on_count"] = false;
    $("filter_top").className = "error";
  } else {
    filter["count"] = count;
    $("filter_top").className = "";
  }
  return filter; 
}

function filter_motif(filter, motif) {
  if (filter["on_db"] && motif["db"] != filter["db"]) return true;
  if (filter["on_id"] && !filter["id"].test(motif["id"])) return true;
  if (filter["on_alt"] && !filter["alt"].test(motif["alt"])) return true;
  return false;
}

function filter_peak(filter, peak) {
  if (filter["on_fisherpv"] && peak["fisher_log_adj_pvalue"] > filter["log_fisherpv"]) return true;
  if (filter["on_pvalue"] && peak["log_adj_pvalue"] > filter["log_pvalue"]) return true;
  if (filter["on_spread"] && peak["spread"] > filter["spread"]) return true;
  if (filter["on_neg"] && peak["neg_log_adj_pvalue"] < filter["neg_log_pvalue"]) return true;
  return false;
}

function filter_CEM_table() {
  "use strict";
  var tbl, tbody, tr, motif, peaks, i, j, filter;
  tbl = $("motifs");
  filter = get_filter();
  for (i = 0; i < tbl.tBodies.length; i++) {
    tbody = tbl.tBodies[i];
    motif = tbody["data_motif"];
    toggle_class(tbody, "filtered", filter_motif(filter, motif));
    for (j = 0; j < tbody.rows.length; j++) {

    }
  }
}

/*
 * show_all_peaks
 *
 * Show or hide sub-peaks
 */
function show_all_peaks(param) {
  var tbl = $("motifs");
  var tbody = tbl.tBodies[0];
  var NValue=param.childNodes[0].nodeValue; // Catch the motif (based on argument value sent by clicking on arrow)
  var bin_number=0;
  for (var i=0; i<tbody.rows.length;i++) { // For each motif
    if (tbody.rows[i].className==param.className) {    // For each sub-peaks
      bin_number++;
      if (must_be_display(param.className,bin_number)==false || NValue=="\u21A5") { // If it has to be hidden or arrow was up
        tbody.rows[i].style.display="none";    // Hide it
      }
      else {
      tbody.rows[i].style.display="table-row";    // Show it
      }
    }
  }
  param.childNodes[0].nodeValue= (NValue=="\u21A7") ? "\u21A5" : "\u21A7" ; // Change arrow orientation
}

function toggle_peaks(e) {
  var expander, group;
  if (!e) e = window.event;
  if (e.target) expander = e.target;
  else if (e.srcElement) expander = e.srcElement;
  group = find_parent(expander.parentNode, "peak_group");
  toggle_class(group, "more");
}

/*
 * must_be_display
 *
 * Check all sub-peaks and verify if they have to be displayed or not (based on filters)
 */
function must_be_display(ID, bin_number) {
  "use strict";
  var motifs, i, motif, peak, log_pvalue_max, log_evalue_max, log_pvalue_min;
  motifs = data['motifs'];
  for (i = 0; i < motifs.length; i++) {
    motif = motifs[i];
    if (motif['db'] + motif['id'] == ID) {    // Catch the motif
      peak = motif['peaks'][bin_number];    // Catch the sub-peaks
      if ($("filter_on_evalue").checked) {
        if ((log_evalue_max = str2log($("filter_evalue").value)) != null) {
          log_pvalue_max = log_evalue_max - Math.log(data['tested']);
        } else {
          log_pvalue_max = 0;
        }
        if (log_pvalue_max < peak['log_adj_pvalue']) return false; 
      }
      if ($("filter_on_fisherpv").checked) {
        if ((log_evalue_max = str2log($("filter_fisherpv").value)) != null) {
          log_pvalue_max = log_evalue_max - Math.log(data['tested']);
        } else {
          log_pvalue_max = 0;
        }
        if (log_pvalue_max < peak['fisher_log_adj_pv']) return false; 
      }
      if ($("filter_on_negbintest").checked) {
        if ((log_pvalue_max = str2log($("filter_negbintest").value)) == null) {
          log_pvalue_min = Math.log(data['tested']);
        }
        if (log_pvalue_min > peak['neg_log_adj_pvalue']) return false; 
      }
      if ($("filter_on_binwidth").checked && 
          parseInt($("filter_binwidth").value) > peak['spread']) {
            return false;
      }
    }
  }
  return true;
}

/*
 * make_PM_table
 *
 * Generate the table which lists plotted motifs
 */
function make_PM_table() {
  swap = null;
  var graphed = [];
  var unused = [];
  for (var i = 1; i < palate.length; i++) {
    if (s_motifs[i-1]) graphed.push(s_motifs[i-1]);
    else unused.push(i);
  }
  graphed.sort(sort_motif_evalue);

  var tbl = $("graph_list");
  var tbody = tbl.tBodies[0];
  while (tbody.rows.length > 0) {
    tbody.deleteRow(0);
  }
  // add the new rows to the table
  for (var i = 0; i < graphed.length; i++) {
    var motif = graphed[i];
    var colouri = motif['colouri'];
    if (!colouri) colouri = 0;
    var row = tbody.insertRow(tbody.rows.length);
    row['motif'] = motif;
    var swatch = make_swatch(colouri);
    swatch.onmousedown = swap_colour;
    add_cell(row, swatch);
    add_cell(row, make_link(motif['id'], motif['url']));
    if (!s_logos[colouri-1]) {
      s_logos[colouri-1] = document.createElement("canvas");
      var pspm = new Pspm(motif['pwm'], motif['id'], 0, 0, 
          motif['motif_nsites'], motif['motif_evalue']);
      var logo = logo_1(alphabet, "", pspm);
      draw_logo_on_canvas(logo, s_logos[colouri-1], false, 0.3);
    }
    add_cell(row, s_logos[colouri-1]);
  }
  var div = $("unused_colours");
  while (div.firstChild) div.removeChild(div.firstChild);
  $("unused_colours_section").style.display = (unused.length > 0 ? "block" : "none");
  for (var i = 0; i < unused.length; i++) {
    var swatch = make_swatch(unused[i]);
    swatch['colouri'] = unused[i];
    swatch.onclick = set_colour;
    div.appendChild(swatch);
  }
}

/*
 * make_MP_graph
 *
 * Create a motif probability graph on the canvas.
 */
function make_MP_graph() {
  var canvas = $("graph");
  canvas.width = canvas.width;
  if (canvas.getContext) {
    var ctx = canvas.getContext('2d');
    make_MP_graph2(ctx, canvas.width, canvas.height);
  }
}

function handle_MP_graph_mousemove(e) {
  "use strict";
  var graph, start, stop, left, width, pop;
  graph = $("graph");
  graph_click["stop"] = e.pageX - graph.getBoundingClientRect().left;
  // constrain stop and start to the graph
  start = graph_click["start"];
  if (start < graph_metrics.left_mark) {
    start = graph_metrics.left_mark;
  } else if (start > graph_metrics.right_mark) {
    start = graph_metrics.right_mark;
  }
  stop = graph_click["stop"];
  if (stop < graph_metrics.left_mark) {
    stop = graph_metrics.left_mark;
  } else if (stop > graph_metrics.right_mark) {
    stop = graph_metrics.right_mark;
  }
  // pick the smaller to be the left
  if (start < stop) {
    left = start;
    width = stop - start;
  } else {
    left = stop;
    width = start - stop;
  }
  // visualize the selected range 
  pop = $("pop_peak");
  if (width > 10) {
    pop.style.width = width + "px";
    pop.style.left = left + "px";
    pop.style.visibility = "visible";
  } else {
    pop.style.visibility = "hidden";
  }
}

function handle_MP_graph_mouseup(e) {
  "use strict";
  var graph, start, stop, left, right, left_val, right_val, pop, l, w, d, unit;
  document.removeEventListener("mouseup", handle_MP_graph_mouseup, false);
  document.removeEventListener("mousemove", handle_MP_graph_mousemove, false);
  graph = $("graph");
  graph_click["stop"] = e.pageX - graph.getBoundingClientRect().left;
  // hide the range preview
  pop = $("pop_peak");
  pop.style.visibility = "hidden";
  // constrain stop and start to the graph
  start = graph_click["start"];
  if (start < graph_metrics.left_mark) {
    start = graph_metrics.left_mark;
  } else if (start > graph_metrics.right_mark) {
    start = graph_metrics.right_mark;
  }
  stop = graph_click["stop"];
  if (stop < graph_metrics.left_mark) {
    stop = graph_metrics.left_mark;
  } else if (stop > graph_metrics.right_mark) {
    stop = graph_metrics.right_mark;
  }
  // pick the smaller to be the left
  if (start < stop) {
    left = start;
    right = stop;
  } else {
    left = stop;
    right = start;
  }
  l = graph_metrics.left_mark;
  w = graph_metrics.right_mark - graph_metrics.left_mark;
  d = graph_metrics.right_val - graph_metrics.left_val;
  unit = w / d;
  // convert into graph values
  left_val = graph_metrics.left_val + Math.round((left - l) / unit);
  right_val =  graph_metrics.left_val + Math.round((right - l) / unit);
  // check if we're doing a legend move and not a zoom
  if ((right - left) < 10 || left_val == right_val) {
    move_legend(e);
    return;
  }
  // add a zoom to the stack
  zooms.push({"left_val": left_val, "right_val": right_val});
  make_MP_graph();
  $("zoom_out").disabled = false;
  $("zoom_center").disabled = false;
}

function handle_MP_graph_mousedown(e) {
  "use strict";
  var graph;
  document.addEventListener("mouseup", handle_MP_graph_mouseup, false);
  document.addEventListener("mousemove", handle_MP_graph_mousemove, false);
  graph = $("graph");
  graph_click["start"] = e.pageX - graph.getBoundingClientRect().left;
  
}

function handle_zoom_out_click() {
  if (zooms.length > 0) {
    zooms.pop();
    make_MP_graph();
    if (zooms.length == 0) {
      $("zoom_out").disabled = true;
      $("zoom_center").disabled = true;
    }
  }
}

function handle_zoom_center_click() {
  var zoom, reach;
  if (zooms.length > 0) {
    zoom = zooms.pop();
    reach = Math.max(1, Math.round((zoom["right_val"] - zoom["left_val"]) / 2));
    zooms.push({"left_val": -reach, "right_val": reach});
    make_MP_graph();
  }
}

function add_MP_graph_listeners() {
  "use strict";
  var graph, zoom_out, zoom_center;
  graph = $("graph");
  graph.addEventListener("mousedown", handle_MP_graph_mousedown, false);
  zoom_out = $("zoom_out");
  zoom_out.disabled = true;
  zoom_out.addEventListener("click", handle_zoom_out_click, false);
  zoom_center = $("zoom_center");
  zoom_center.addEventListener("click", handle_zoom_center_click, false);
  zoom_center.disabled = true;
}

function download_eps() {
  var canvas = $("graph");
  canvas.width = canvas.width;
  if (canvas.getContext) {
    var ctx = canvas.getContext('2d');
    var eps_ctx = new EpsContext(ctx, canvas.width, canvas.height);
    eps_ctx.register_font("14pt Helvetica", "Helvetica", 14 / 3 * 4);
    eps_ctx.register_font("16px Helvetica", "Helvetica", 16);
    eps_ctx.register_font("9px Helvetica", "Helvetica", 9);
    make_MP_graph2(ctx, canvas.width, canvas.height);
    $("eps_content").value = eps_ctx.eps();
  }
}

function make_MP_graph2(ctx, width, height) {
  "use strict";
  var windo, type, legend, plot_negative, plot_distance, motifs, rset, i, motif;
  var name, sig, colour, weights, graph, peak_highlight;
  // get the graph settings
  windo = parseInt($("windo").value);
  if (isNaN(windo) || windo < 1) {
    $("windo").value = windo = default_smoothing_window;
  }
  type = parseInt($("plot_type").value);
  legend = parseInt($("legend").value);
  plot_negative = parseInt($("plot_negative").value);
  plot_distance = parseInt($("plot_distance").value) != 0;
  // get the selected motifs
  motifs = [];
  for (i = 0; i < s_motifs.length; i++) {
    if (s_motifs[i] != null) motifs.push(s_motifs[i]);
  }
  // sort the motifs
  motifs.sort(sort_motif_evalue);
  // create a result set with all the selected motifs
  rset = new CentrimoRSet(data["seqlen"]);
  for (i = 0; i < motifs.length; i++) {
    motif = motifs[i];
    name = motif["id"];
    if (motif["alt"]) name = motif["alt"] + " " + motif["id"];
    sig = "p=" + log2str(motif["best_log_adj_pvalue"], 1);
    colour = palate[motif["colouri"]];
    if (plot_negative) {
      rset.add(name, sig, colour, motif["len"], motif["total_sites"],
        motif["sites"], motif["neg_total_sites"], motif["neg_sites"]);
    } else {
      rset.add(name, sig, colour, motif["len"], motif["total_sites"],
        motif["sites"], 0, 0);
    }
  }
  // get the smoothing weights
  weights = (type == 1 ? triangular_weights(windo) : uniform_weights(windo));
  // get the zoom
  var range_left = null;
  var range_right = null;
  if (zooms.length > 0) {
    var zoom = zooms[zooms.length - 1];
    range_left = zoom["left_val"];
    range_right = zoom["right_val"];
  }
  // now make a new graph from the result set and smoothing weights
  graph = new CentrimoGraph(rset, weights, "CentriMo " + data["version"], range_left, range_right, plot_distance);
  graph_metrics = graph.draw_graph(ctx, width, height, legend, legend_x, legend_y);
  peak_highlight = $("pop_peak");
  peak_highlight.style.top = graph_metrics.top_edge + "px";
  peak_highlight.style.height = (graph_metrics.bottom_edge - graph_metrics.top_edge) + "px";
}

function sync_sort_selection () {
  "use strict";
  var i, mapper, motif_sort, region_sort;
  motif_sort = $("motif_sort");
  region_sort = $("peak_sort");
  if (typeof sync_sort_selection.mapper === "undefined") {
    var id2idx;
    // first map region id to index
    id2idx = {};
    for (i = 0; i < region_sort.options.length; i++) {
      id2idx[sort_table["region"][parseInt(region_sort.options[i].value, 10)]["id"]] = i;
    }
    // now generate a mapping of index in motif sort to index in region sort
    mapper = [];
    for (i = 0; i < motif_sort.options.length; i++) {
      mapper[i] = id2idx[sort_table["motif"][parseInt(motif_sort.options[i].value, 10)]["pair"]];
    }
    sync_sort_selection.mapper = mapper;
  } else {
    mapper = sync_sort_selection.mapper;
  }
  if (!$('allow_peak_sort').checked) {
    region_sort.selectedIndex = mapper[motif_sort.selectedIndex];
  }
}

function populate_sort_list (sellist, items) {
  var i, j, item, opt, priority, selected;
  priority = 0;
  selected = 0;
  for (i = 0, j = 0; i < items.length; i++) {
    item = items[i];
    if (typeof item["show"] === 'undefined' || item["show"]) {
      opt = document.createElement("option");
      opt.innerHTML = item["name"];
      opt.value = i;
      sellist.add(opt, null);
      if (typeof item["priority"] !== 'undefined' && item["priority"] > priority) {
        selected = j;
        priority = item["priority"];
      }
      j++;
    }
  }
  sellist.selectedIndex = selected;
}

function populate_sort_lists() {
  "use strict";
  var i, motif_sort, region_sort, motif_sort_list, region_sort_list;
  motif_sort = $("motif_sort");
  region_sort = $("peak_sort");
  try {motif_sort.removeEventListener("click", sync_sort_selection, false);} catch (e) {}
  try {motif_sort.removeEventListener("change", sync_sort_selection, false);} catch (e) {}
  for (i = motif_sort.options.length-1; i >= 0; i--) motif_sort.remove(i);
  for (i = region_sort.options.length-1; i >= 0; i--) region_sort.remove(i);
  motif_sort_list = sort_table["motif"];
  region_sort_list = sort_table["region"];
  populate_sort_list(motif_sort, motif_sort_list);
  populate_sort_list(region_sort, region_sort_list);
  sync_sort_selection();
  motif_sort.addEventListener("click", sync_sort_selection, false);
  motif_sort.addEventListener("change", sync_sort_selection, false);
}

function make_other_settings() {
  $("opt_obj").textContent = data.options.cd ? "central distance enrichment (CD)" : (data.options.local ? "local region enrichment (LE)" : "central region enrichment (CE)");
  $("opt_xalph").textContent = data.options.xalph != "" ? "Yes: use alphabet in file" + data.options.xalph: "No";
  $("opt_motif_pseudo").textContent = data.options.motif_pseudo;
  $("opt_seqlen").textContent = data.options.seqlen == 0 ? "None" : data.options.seqlen;
  $("opt_use_pvalues").textContent = data.options.use_pvalues ? "p-values" : "log-odds scores";
  $("opt_score").textContent = data.options.use_pvalues ? data.options.score : 
    data.options.use_lo_fraction ? 100*data.options.score + "% of maximum log-odds score" : data.options.score + " (bits)";
  $("opt_optimize_score").textContent = data.options.optimize_score ? "Yes" : "No";
  $("opt_minreg").textContent = data.options.minbin;
  $("opt_maxreg").textContent = data.options.maxbin;
  $("opt_strands").textContent = data.options.norc ? (data.options.sep ? "scan with complementary motifs, too" : "scan given strands only") : "scan both strands if alphabet is complementable";
  $("opt_flip").textContent = data.options.flip ? "'reflected' around sequence centers" : "same as for positive strand";
  $("opt_noseq").textContent = data.options.noseq ? "No" : "Yes";

}

    </script>
    <style type="text/css">
div.graph_box {
  position: relative;
}
div.pop_graph_peak {
  position:absolute; 
  left: 0;
  top: 0; 
  z-index: 5; 
  width: 10px;
  height: 10px; 
  opacity: 0.2; 
  background-color: #3333ff;
  visibility: hidden;
}
table.inputs, table.alpha_bg_table {
  margin-top: 20px;
  border-collapse:collapse;
}
table.inputs * td, table.inputs * th, table.alpha_bg_table * td, table.alpha_bg_table * th {
  padding-left: 15px;
  padding-right: 15px;
  padding-top: 1px;
  padding-bottom: 1px;
}
table.motifs {
  margin-top: 20px;
  border-collapse:collapse;
}
table.motifs * td, table.motifs * th {
  padding-left: 15px;
  padding-right: 15px;
  padding-top: 1px;
  padding-bottom: 1px;
}
table.motifs * td.col_blocation, table.motifs * td.col_bwidth, 
table.motifs * td.col_bsites, table.motifs * td.col_tsites,
table.motifs * td.col_maxprob, table.motifs * td.col_concentration,
table.motifs * td.col_problocation,
table.motifs * td.col_nbinstested, table.motifs * td.col_score {
  text-align: right;
  padding-right: 40px;
}
table.motifs tbody:hover { 
  background: #ddddff; 
}
table.motifs tbody tr:hover {
  background: #ccccff; 
}
table.hide_db .col_db {
  display: none;
}
table.hide_id .col_id {
  display: none;
}
table.hide_name .col_name {
  display: none;
}
table.hide_consensus .col_consensus {
  display: none;
}
table.hide_fisherpv .col_fisherpv {
  display: none;
}
table.hide_evalue .col_evalue {
  display: none;
}
table.hide_pvalue .col_pvalue {
  display: none;
}
table.hide_MCC .col_MCC {
  display: none;
}
table.hide_concentration .col_concentration {
  display: none;
}
table.hide_maxprob .col_maxprob {
  display: none;
}
table.hide_bsites .col_bsites {
  display: none;
}
table.hide_negbsites .col_negbsites {
  display: none;
}
table.hide_blocation .col_blocation {
  display: none;
}
table.hide_hpeak .col_problocation {
  display: none;
}
table.hide_bwidth .col_bwidth {
  display: none;
}
table.hide_tsites .col_tsites {
  display: none;
}
table.hide_negtsites .col_negtsites {
  display: none;
}
table.hide_nbinstested .col_nbinstested {
  display: none;
}
table.hide_score .col_score {
  display: none;
}
table.hide_negative_binomial .col_negative_binomial {
  display: none;
}
table.hide_OEbins .col_OEbins {
  display: none;
}
div.graph_options_section {
  width:30%; 
  float:right;
}
div.graph_options_section h5 {
  margin-top: 10px;
}
table.graph_list {
  border-collapse:collapse;
}
table.graph_list * td, table.graph_list * th {
  padding-left: 5px;
  padding-right: 5px;
  padding-top: 1px;
  padding-bottom: 1px;
}
th.deselect {
  font-size:25px; 
  cursor: default;
}
th.deselect:hover {
  color: red;
}
div.filter {
  display: inline-block;
  padding-right: 10px;
}
div.swatch {
  margin: auto;
  width: 20px;
  height: 20px;
  text-align: center;
  font-size: 16px;
  border: 1px solid black;
  cursor: default;
}
div.swatch:hover {
  width: 16px;
  height: 16px;
  font-size: 16px;
  border: 3px outset black;
}
div.swatch:active {
  width: 16px;
  height: 16px;
  font-size: 16px;
  border: 3px inset black;
}
span.expander {
  cursor: pointer;
  font-size: larger;
}
div.pop_logo {
  position:absolute;
  z-index:1;
  top:0px;
  left:0px;
  border: 3px outset black;
  background-color: white;
  display:none;
}
div.pop_colour {
  position:absolute;
  z-index:1;
  top:0px;
  left:0px;
  margin-left: -13px;
  margin-top: -13px;
  display:none;

}
div.pop_content {
  position:absolute;
  z-index:1;
  width:300px;
  padding: 5px;
  background: #E4ECEC;
  font-size: 12px;
  font-family: Arial;
  border-style: double;
  border-width: 3px;
  border-color: #AA2244;
  display:none;
}

span.arrow {
  font-size: larger;
  color: red;
}

#unused_colours div.swatch {
  display: inline-block;
  margin-right: 5px;
}

.no_swatch {
  text-align: center;
  font-size: larger;
}

input.error:enabled {
  background: #FF5555;
}

tr.sub_peak {
  display: none;
}

tbody.more > tr.sub_peak {
  display: table-row;
}

    </style>
    <style type="text/css">
/* The following is the content of meme.css */
body { background-color:white; font-size: 12px; font-family: Verdana, Arial, Helvetica, sans-serif;}

div.help {
  display: inline-block;
  margin: 0px;
  padding: 0px;
  width: 12px;
  height: 13px;
  cursor: pointer;
  background-image: url(data:image/gif;base64,R0lGODlhDAANAIABANR0AP///yH5BAEAAAEALAAAAAAMAA0AAAIdhI8Xy22MIFgv1DttrrJ7mlGNNo4c+aFg6SQuUAAAOw==);
}

div.help:hover {
  background-image: url(data:image/gif;base64,R0lGODlhDAANAKEAANR0AP///9R0ANR0ACH+EUNyZWF0ZWQgd2l0aCBHSU1QACH5BAEAAAIALAAAAAAMAA0AAAIdDGynCe3PgoxONntvwqz2/z2K2ImjR0KhmSIZUgAAOw==);
}

p.spaced { line-height: 1.8em;}

span.citation { font-family: "Book Antiqua", "Palatino Linotype", serif; color: #004a4d;}

p.pad { padding-left: 30px; padding-top: 5px; padding-bottom: 10px;}

td.jump { font-size: 13px; color: #ffffff; background-color: #00666a;
  font-family: Georgia, "Times New Roman", Times, serif;}

a.jump { margin: 15px 0 0; font-style: normal; font-variant: small-caps;
  font-weight: bolder; font-family: Georgia, "Times New Roman", Times, serif;}

h2.mainh {font-size: 1.5em; font-style: normal; margin: 15px 0 0;
  font-variant: small-caps; font-family: Georgia, "Times New Roman", Times, serif;}

h2.line {border-bottom: 1px solid #CCCCCC; font-size: 1.5em; font-style: normal;
  margin: 15px 0 0; padding-bottom: 3px; font-variant: small-caps;
  font-family: Georgia, "Times New Roman", Times, serif;}

h4 {border-bottom: 1px solid #CCCCCC; font-size: 1.2em; font-style: normal;
  margin: 10px 0 0; padding-bottom: 3px; font-family: Georgia, "Times New Roman", Times, serif;}

h5 {margin: 0px}

a.help { font-size: 9px; font-style: normal; text-transform: uppercase;
  font-family: Georgia, "Times New Roman", Times, serif;}

div.pad { padding-left: 30px; padding-top: 5px; padding-bottom: 10px;}

div.pad1 { margin: 10px 5px;}

div.pad2 { margin: 25px 5px 5px;}
h2.pad2 { padding: 25px 5px 5px;}

div.pad3 { padding: 5px 0px 10px 30px;}

div.box { border: 2px solid #CCCCCC; padding:10px; overflow: hidden;}

div.bar { border-left: 7px solid #00666a; padding:5px; margin-top:25px; }

div.subsection {margin:25px 0px;}

img {border:0px none;}

th.majorth {text-align:left;}
th.minorth {font-weight:normal; text-align:left; width:8em; padding: 3px 0px;}
th.actionth {font-weight:normal; text-align:left;}

.explain h5 {font-size:1em; margin-left: 1em;}

div.doc {margin-left: 2em; margin-bottom: 3em;}

th.trainingset {
  border-bottom: thin dashed black; 
  font-weight:normal; 
  padding:0px 10px;
}
div.pop_content {
  position:absolute;
  z-index:50;
  width:300px;
  padding: 5px;
  background: #E4ECEC;
  font-size: 12px;
  font-family: Arial;
  border-style: double;
  border-width: 3px;
  border-color: #AA2244;
  display:none;
}

div.pop_content > *:first-child {
  margin-top: 0px;
}

div.pop_content h1, div.pop_content h2, div.pop_content h3, div.pop_content h4, 
div.pop_content h5, div.pop_content h6, div.pop_content p {
  margin: 0px;
}

div.pop_content p + h1, div.pop_content p + h2, div.pop_content p + h3, 
div.pop_content p + h4, div.pop_content p + h5, div.pop_content p + h6 {
  margin-top: 5px;
}

div.pop_content p + p {
  margin-top: 5px;
}

div.pop_content > *:last-child {
  margin-bottom: 0px;
}

div.pop_content div.pop_close {
  /* old definition */
  float:right;
  bottom: 0;
}

div.pop_content span.pop_close, div.pop_content span.pop_back {
  display: inline-block;
  border: 2px outset #661429;
  background-color: #CCC;
  padding-left: 1px;
  padding-right: 1px;
  padding-top: 0px;
  padding-bottom: 0px;
  cursor: pointer;
  color: #AA2244; /*#661429;*/
  font-weight: bold;
}

div.pop_content span.pop_close:active, div.pop_content span.pop_back:active {
  border-style: inset;
}

div.pop_content span.pop_close {
  float:right;
  /*border: 2px outset #AA002B;*/
  /*color: #AA2244;*/
}

div.pop_content:not(.nested) .nested_only {
  display: none;
}

div.pop_back_sec {
  margin-bottom: 5px;
}

div.pop_close_sec {
  margin-top: 5px;
}

table.hide_advanced tr.advanced {
  display: none;
}
span.show_more {
  display: none;
}
table.hide_advanced span.show_more {
  display: inline;
}
table.hide_advanced span.show_less {
  display: none;
}


/*****************************************************************************
 * Program logo styling
 ****************************************************************************/
div.prog_logo {
  border-bottom: 0.25em solid #0f5f60;
  height: 4.5em;
  width: 24em;
  display:inline-block;
}
div.prog_logo img {
  float:left;
  width: 4em;
  border-style: none;
  margin-right: 0.2em;
}
div.prog_logo h1, div.prog_logo h1:hover, div.prog_logo h1:active, div.prog_logo h1:visited {
  margin:0;
  padding:0;
  font-family: Arial, Helvetica,  sans-serif;
  font-size: 3.2em;
  line-height: 1em;
  vertical-align: top;
  display: block;
  color: #026666;
  letter-spacing: -0.06em;
  text-shadow: 0.04em 0.06em 0.05em #666;
}
div.prog_logo h2, div.prog_logo h2:hover, div.prog_logo h2:active, div.prog_logo h2:visited {
  display: block;
  margin:0;
  padding:0;
  font-family: Helvetica, sans-serif;
  font-size: 0.9em;
  line-height: 1em;
  letter-spacing: -0.06em;
  color: black;
}

div.big.prog_logo {
  font-size: 18px;
}


    </style>
  </head>
  <body onload="page_loaded()" onpageshow="page_shown(event)">
    <!-- Popups -->
    <div id="logo_popup" class="pop_logo">
      <canvas id="logo_popup_canvas" width="200" height="50"></canvas>
      <canvas id="logo_popup_canvas_rc" width="200" height="50"></canvas>
    </div>
    <!-- Help popups -->
    <div class="pop_content" id="pop_alph_name">
      <script>print_doc_para('pop_alph_name', 'alph-name', 'The ');</script>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_alph_bg">
      <script>print_doc_para('pop_alph_bg', 'alph-bg', 'The ');</script>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_results">
      <script>print_doc("pop_results", "centrimo-results-tsv");</script>
      <script>print_doc("pop_results", "motif-consensus");</script>
      <div style="float:right; bottom:0px;">[
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_sites">
      <script>print_doc("pop_sites", "centrimo-sites-txt");</script>
      <div style="float:right; bottom:0px;">[
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" style="width:400px" id="pop_prob_graph">
      <p>Each "motif probability curve" shows the (estimated) probability of the
      <b>best</b> match to a given motif occurring at a given position in the
      input sequences.  This estimated probability is based only on sequences that
      contain at least one match with <span id="ins_pop_prob_graph2"></span> <span id="ins_pop_prob_graph1"></span>
      than the <span id="ins_pop_prob_graph3"></span> threshold defined for this motif, 
      and is the maximum likelihood estimate of the conditional probability shown below.</p>
      <p>Points (X,Y) on the plot are:<br>
      &nbsp;&nbsp;Y = Pr(best match occurs at position X | sequence contains a match)</p>
      <p><b>Note:</b> The plots are smoothed according to the function 
      selected from the "Smoothing" menu on the right. Setting the smoothing
      window size to 1 turns off smoothing.</p>
      <p>If a negative dataset has been supplied then two curves are drawn for
      each motif, one for each dataset. The distribution of the motif in the
      primary dataset is plotted with a single unbroken curve, whereas the distribution in
      the negative dataset is plotted with a dashed curve.</p>
      <script>
	$("ins_pop_prob_graph1").innerHTML = (data['options']['use_pvalues']) ? "below" : "above";
	$("ins_pop_prob_graph2").innerHTML = (data['options']['use_pvalues']) ? "adjusted motif <i>p</i>-value" : "score";
	$("ins_pop_prob_graph3").innerHTML = (data['options']['use_pvalues']) ? "<i>p</i>-value" : "score";
      </script>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_plotting">
      <p>This shows a listing of all motifs currently plotted on the graph.</p>
      <p>The color used to plot a motif can be changed by clicking on the
      color swatch next to the motif you want to change, followed by clicking
      on the color swatch you wish to swap it with.</p>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_unused_colours">
      <p>These are extra colors you may use for plotting motifs.</p>  
      <p>Click on the color swatch next to one of the above motifs, then click 
      on one of these "unused color" swatches to change the color of the 
      motif's plot.</p>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" style="width: 500px" id="pop_graph">
      <p>These options change the display of the graph.</p>
      <dl>
        <dt>Smoothing:</dt>
        <dd><p>Allows selection of the smoothing function applied to the graph.</p>
        <p>The weighted moving average option uses weights shaped as an isosceles 
        triangle where the central point (or points in an even sized window) 
        get the maximum weight.</p>
        <p>The moving average simply weights all points in the smoothing window 
        equally.</p> 
        <p><b>Note:</b> Setting the smoothing window size to 1 turns off 
        smoothing.</dd></p>
        <dt>Window</dt>
        <dd><p>The window size used to smooth the graph. The larger the smoothing
        window size, the smoother the graph, at the cost of hiding detail.</p> 
        <p>Below a smoothing window size of 10, thinner lines are used on the 
        graph to allow more detail to be visible.</p>
        <p><b>Note:</b> Remember to press "return" or "enter" after changing 
        the number in the input box in order to see the effect of the new 
        smoothing window size.</p></dd>
        <dt>Legend</dt>
        <dd><p>Choose to display/disable the on-graph legend. The legend can be 
        moved by clicking on the graph.</p></dd>
        <dt>Negative Sequences</dt>
        <dd><p>Choose whether to plot the motif probability curve(s) for the
        negative sequences (if provided). The curve(s) are plotted as dashed
        lines, using the same color as the corresponding curve for the positive
        sequences.</p></dd>
        <dt>Zoom</dt>
        <dd>Drag a range on the graph to zoom into that section. Clicking
        "Undo Zoom" will return the view to the previously displayed part of the
        graph and clicking "Center on 0" will move the view so 0 is in the
        center.</dd>
        <dt>Download EPS</dt>
        <dd><p>Download the graph that you are currently viewing as an 
        encapsulated postscript (EPS) image. EPS images are scalable making them
        suitable for publication.</p></dd>
      </dl>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_filtering">
      <p>List only enriched motifs that meet the selected filter criteria below.</p>
      <p><b>Selected motifs are always listed</b>; deselect all motifs first by clicking on
      the "X" above the color swatches if you wish to filter all motifs.</p>
      <p>To filter on "ID" or "Name", you can enter any Javascript regular
      expression pattern.  See <a href="http://www.w3schools.com/jsref/jsref_obj_regexp.asp">here</a>
      for documentation on Javascript regular expression patterns.</p>
      <div style="float:right; bottom:0px;">[
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_sorting">
      <p>Sorting is applied after filtering where possible (the exception being
      the "Top" filter) so the filters applied will affect the sort.  You can
      choose the motif sorting feature using the "Motifs:" menu.</p> 
      <p>If CentriMo is searching for locally enriched regions (not just centrally
      enriched regions), then multiple regions may be found per motif, and
      the "Regions:" menu will also be displayed.  In this case, 
      CentriMo first sorts all regions using the feature
      shown in the "Regions:" menu, and then it sorts the highest-ranked
      region of each motif according to the feature shown in the "Motifs:" menu.
      </p>
      <p>
      Unless you check the box next to the "Regions:" menu, it will automatically 
      show the same feature as the "Motifs:"
      menu (or "<i>E</i>-value" if a motif-only feature is chosen in the "Motifs:" menu). 
      </p>
      <p>
      <b>Note:</b>The motif <i>p</i>-value shown in the plot legend will always be for
      the region with the lowest <i>p</i>-value, and therefore may not match the value
      shown in the table "<i>p</i>-value" column 
      when the "Regions:" menu is not set to "<i>p</i>-value".
      </p>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_db">
      <script>print_doc_para('pop_db', 'motif-db', 'motif.');</script>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_id">
      <script>
        var html2 = '<p>If more than one motif has the same ID, CentriMo uses only the first such motif.</p>';
        print_doc_para('pop_id', 'motif-id');
        document.getElementById('pop_id').insertAdjacentHTML('beforeend', html2);
      </script>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_name">
      <script>print_doc_para('pop_name', 'motif-alt-id');</script>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_consensus">
      <script>print_doc("pop_consensus", "motif-consensus");</script>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_fisherpv">
      <p>The expected number motifs that would have least one 
        region as <b>comparatively</b> enriched for 
        best matches to the motif as the reported region in the
        <b>positive</b> sequences compared with the <b>negative</b>
        sequences.  
      </p>
      <p>
        The Fisher <i>E</i>-value is the (one-sided) <i>p</i>-value of 
	the one-sided Fisher's exact test that <b>at least</b> as many best matches 
	in the region in the positive sequences that contain at least 
	one match, multiplied by the number of motifs in the input database(s).
        The Fisher's exact test <i>p</i>-value is corrected for the number
	of regions and score thresholds tested ("Multiple Tests").
      </p>
      <p>
        Fisher's exact test assumes that the probability that the best match 
	(if any) falls into a given region is the same for all 
	positive and negative sequences.
      </p>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_pvalue">
      <script>print_doc_para("pop_pvalue", "centrimo-adj-pvalue", "<p>The enrichment <i>p</i>-value of a motif is <span id='ins_pop_pvalue'></span></p>");</script>
      <script>
        if (data['options']['disc']) {
	  $("ins_pop_pvalue").innerHTML = 'calculated using Fisher\'s exact test on the enrichment of best matches in the positive sequences ("Region Matches") relative to the negative sequences ("Negative Region Matches"), corrected for the number of regions and score thresholds tested ("Multiple Tests").  The test assumes that the probability that the best match (if any) falls into a given region is the same for all positive and negative sequences.';
        } else if (data['options']['cd']) {
	  $("ins_pop_pvalue").innerHTML = 'the probability that the optimal average distance between the best site and the sequence center would be as low or lower than observed, computed using the cumulative Bates distribution.';
        } else {
 	  $("ins_pop_pvalue").innerHTML = 'calculated by using the one-tailed binomial test on the number of sequences with a match to the motif ("Sequence Matches") that have their best match in the reported region ("Region Matches"), corrected for the number of regions and score thresholds tested ("Multiple Tests").  The test assumes that the probability that the best match in a sequence falls in the region is the region width divided by the number of places a motif can align in the sequence (sequence length minus motif width plus 1).';
        }
      </script>

      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_evalue">
      <script>print_doc_para("pop_evalue", "centrimo-evalue", "<span id='ins_pop_evalue'></span>");</script>
      <script>
	$("ins_pop_evalue").innerHTML = (data['options']['cd'] ?
		"optimal average distance to the sequence center as low as observed."
		: "at least one region as enriched for best matches to the motif as the reported region.");
      </script>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_MCC">
      <p>The Matthew's Correlation Coefficient (MCC) gives a measure of the ability
      of the motif to discriminate the positive sequences from the negative sequences:
      <dl>
        <dt> MCC = [TP*TN - FP*FN] / [(TP + FP) * (TP + FN) * (TN + FP) * (TN + FN)]</dt>
      </dl>
      where 
      <dl>
        <dd>TP is the number of positive sequences with a best match in the reported region,</dd>
        <dd>FP is the number of negative sequences with a best match in the reported region,</dd>
        <dd>TN is the number of negative sequences without a best match in the reported region, and</dd>
        <dd>FN is the number of positive sequences without a best match in the reported region.</dd>
      </dl>
      <p>MCC ranges from -1 to +1, where a +1 result indicates that the occurrence
      of the best match to the motif in the reported region perfectly discriminates positive
      sequences from negative sequences.
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_binw">
      <script>print_doc_para("pop_binw", "centrimo-bin-width");</script>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_bin_sites">
      <script>print_doc_para("pop_bin_sites", "centrimo-sites-in-bin", "<span id='ins_bin_sites'></span>");</script>
      <script>
	$("ins_bin_sites").innerHTML = (data['options']['cd']) ? "is anywhere in the sequence." : "is in the reported region.";
      </script>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_neg_bin_sites">
      <p>The number of <b>negative</b> sequences where the <b>best</b> match to
      the motif falls in the reported region. This value is rounded but the
      underlying value may contain fractional counts.</p>
      <p><b>Note:</b> This number may be less than the number of <b>negative</b>
      have a best match in the region. The reason for this is that a sequence may
      have many matches that score equally best. If <i>n</i> matches have the
      best score in a sequence, 1/<i>n</i> is added to the appropriate bin
      for each match.</p>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_total_sites">
      <p>The number of sequences containing a match to the motif 
      <b><span id="ins_pop_total_sites1"></span></b> the <span id="ins_pop_total_sites2"></span>
      threshold ("Score Threshold").</p>
      <script>
	$("ins_pop_total_sites1").innerHTML = (data['options']['use_pvalues']) ? "below" : "above";
	$("ins_pop_total_sites2").innerHTML = (data['options']['use_pvalues']) ? "<i>p</i>-value" : "score";
      </script>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_score">
      <p>This is the <span id="ins_pop_score1"></span> threshold 
        (<span id="ins_pop_score2"></span>)
        for determining if a sequence contains a match to this motif.</p>  
      <script>
	$("ins_pop_score1").innerHTML = (data['options']['use_pvalues']) ? "<i>p</i>-value" : "score";
	$("ins_pop_score2").innerHTML = (data['options']['use_pvalues']) ? "adjusted motif <i>p</i>-value" : "bits";
      </script>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_neg_total_sites">
      <p>The number of <b>negative</b> sequences containing a match to the motif
      above the score threshold. When score optimization is enabled the
      score threshold may be raised higher than the minimum.</p>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_negative_binomial">
      <p>The probability that any tested region in the <b>negative</b>
      sequences would be as enriched for best matches to this motif according
      to the Binomial test.</p> 
      <p>Use the filter to display only motifs differentially enriched in both
      datasets (low <i>p</i>-value and high negative <i>p</i>-value).</p>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_prob">
      <p>The maximum probability that the best match occurs at any single sequence position.
      If the smoothing window size ("Window:", to right of graph) is set to "1", then this is value is
      the maximum value of the match-probability curve.</p>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_concentration">
      <p><b>Concentration</b> is defined as the total probability of all the positions in the central
	region whose width is the same as the size of the "smoothing window".
	You can change the size of the smoothing window using the "Window:" 
	input field in the <b>Graph</b> options section, above.</p>
      <p>The "concentration" of the motif sites in the central window
	can somtimes be more informative than the <i>E</i>-value.  For example,
	in some ChIP-seq datasets, motifs for cofactors show more significant
	enrichment overall (smaller <i>E</i>-value), but are less
	concentrated in a small (20 to 50bp) window than the motif for
	the ChIP-ed transcription factor.  In such cases, you may wish
	to sort the motifs by Concentration, using the <b>Sort</b>
	menu, below.</p>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_nbinstested">
      <script>print_doc_para("pop_nbinstested", "centrimo-mult-tests");</script>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_bin_location">
      <p>Location of the center of the most enriched region.</p>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_SMmotifs">
      <p>The text box lists the sequence identifiers for sequences that 
      <span id="ins_pop_SMmotifs"></span> <b>all</b> the
      selected motifs.
      <script>
	$("ins_pop_SMmotifs").innerHTML = (data['options']['cd']) 
          ? "contain a match to" 
          : "have at least one of their best matches in the most significant region of";
      </script>
      <p>The "Intersection" subheading gives the number of identifiers in the
      text box and their percentage out of the total number of input sequences.</p>
      <p>The "Union" subheading lists the number and percentage of
      sequences that have at least one of their best matches in the most
      significant region of <b>any</b> of the selected motifs and their 
      percentage out of the total number of input sequences.</p>
      <p>Note that the number of sequences with a match to a given motif in
      its best region may be larger than the value of "Region Matches". This is because
      a sequence may have multiple equally best matches and in that case a
      fractional match count is assigned to each of them when "Region Matches" is computed.</p>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_OEbins">
      <p>When more than one significant, non-overlapping region is found,
      they can be shown (and hidden again) by clicking the arrow.</p>
      <p>By default the regions are sorted by <i>E</i>-value, but this can be
      changed by the menu on the right of the page.</p>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_problocation">
      <p>Sequence position where the (unsmoothed) match-probability curve for this motif 
      attains its maximum.  Set the smoothing window size ("Window:", to right of graph) to
      "1" to see the unsmoothed match probability curve.</p>
      <div style="float:right; bottom:0px;">[ 
        <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <!-- Page starts here -->
    <div id="top" class="pad1">
      <div class="prog_logo big">
        <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wLGwYsOTtZCG8AAAA8dEVYdENvbW1lbnQAIEltYWdlIGdlbmVyYXRlZCBieSBHUEwgR2hvc3RzY3JpcHQgKGRldmljZT1wbm1yYXcpCgcnzvAAACAASURBVHja7Z13YBVVvsc/M3P7vSk3BVJIQiihN0MVUDpSFBAFsXcEy/pW1HXbs6xrWZ9dV11FBSuKCNK7CSUJoQYIJKT3kH57mZn3R9wgG1TePnUp8/nrkjNzuHPO9/7O+f3OOb8BDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDY0LBwGYoTXDRYkE5AmAqrXFRctrun9+qnZUXxRPbPs2A+v0mahhoQguN4FxY2j64C2UENtF0+sxITH//OgXLzbJq4cOosTE0Lzic3x/fAxd9j7CHnviojUBuovtgS2HjqLExRBI6YpvyCBCDXrMz/yN0IR4Wh59UBPABT/rPZqLGtsRzGYAWhbegZhzGNNfngWzmZYH5l9U7XFRDQECAkJeHnKneBSD/ru5sITjlb/hHz8W01+exX7zfPRllZoALkRM1XWoXi9K56TT/i6bjTR99QmeJ/+MYd0GwqdejTn7gCaAC46DB0CSkLt0PkNLCDjuuY2WbevB6cQ2Yw7mzds1AVxIGA4cBp2OQJekH7zG07cn7k1rICwU263zMezZrwngQkGfcwTVoEfo0vVHr3N1S6L+2w2oOh2Wt96FYFATwAXB4cOodjt+i/EnL1WiIghMnoBYUQmKqgngvP/1O90IzS0IPXqc3Q2qCp3i0bu9oCpaHOC8p6oK1etBGZx6lj6jgBofj1pdDYqiWYDzXumFJUg+P57+vc5aAP6YaITGRjAaNQGc70ilZSDLCH36nvU9SlgoCAKWonJNAOc7QkUFqiThTu509jeZLaghIQhHczUBnNe/fn8QQ85R6N///3SfGmJFlWUoLdUEcF7+6hGwffAJ4eOnIW3cjNK79//pfjnEhmoPR19UonkB5yNhL7+J4c9PooaF4X/rTZrmzfy/VWBrFYCxtEITwHlpATKzEEwmasuO/XsVWK0QEoJaVKQNAefduN/UjFhcijpp0r9dhyJAMCoCios1AZx3pq28CqmxCffll/6/6lHjO4HXi9EvawI4r6goh9palIkT/n/1dOgAgoCQl68J4LxBUTHk5EJiIu7O8e2K606KNDVKZ+cJxH23g7aiQhPAeYMcRJ++i0D3LhA83XR7PAKP3BfJhtWWs6oqkBCHKghIpeWaAM6b2X9QRneiAOXSESCd/og1FQZkWUT26VHPZpU3Ng5BkjBeoPsEL0gBGCtroLoaT+oAEITTylwugSum+SgqUThZrf/pSWBsDKooIlyg0cALUwDrN0NoKGrHju2nB0EdtjA/kZHwzfKfPg0UkECwWS/YWMAFKQDTtjSCneJROnZoV5a+XU/QL3HNdV4qKqG08Cx2ByUlITU2oUPSBHCuo/cFULduRe3RnWB4GHJQIBA4VV5braNzdw9Gi59x41Ty83+6CcROCaheL9TXaQI417E98DAEAnhuv56KSj2vvxBGwXETAJXlOgYNDtCtG4SEKlSUK8g+Iyerfzwi7kvpAl4v+HwYyqswf7lSE8A5afrTMzB89TXBeXPwXnopW1ZbSP/WiNP5XbkJfP4gDmfr9H/srHryD+rJ2Wf5UY/A370rkttD2KI/EnbFDGwPPYZO1GkCOKdcP7cb82t/R7VaaXnzZfJyTbhcCjfdpLBto5VgQGD3Dj15R83ExysU6gqYFT8G9x1vU17vY/OaH54QCsnJ4PMhrV6DUN8AHg9i/glNAOcS5uwDGHbuxvniswR1IscO6+nWXWHSzHoMBijKN3HssIVOyT42GVax0HgvC4IL2J7yNrV9t1JcYGTLevOZXcHkzsijR+LctBbP6y+B14tYUHhBtNsFsxxsXPYlckQknkmjqTspIcsiyd1dmC0K/foHKSoUSUkOUtX/W57Xv8hDwd8x0jcSxaxwYtRaEvPGYzQJeL0CJtPp44G3QwTeVV+h6lRM0bFYVDDk5uGdNE6zAOcKWfvCmB94kxVfR7Pi40jKysAe0dqRktGLKBtxRlazVPcR98sPMMY3Bhs2+gb74hIceGNKqCgTQBXaWwBRZKt5K0f0R0jrcZLN41XI1YaAc4ajh60szenJlKFVOINmevZ14mhRiYpuXQfo1SdIdrbMn9ZlMioyha7Bbhhp9f97BnpSL7dQMvk9jmVbyT3cGh1UVdi4KozHng3wpO45Xje+zkf6j3ja8DivPGbG66xE9Po1AfwnkBDaZuFHc6xsfa+B+8RPuWKqgRtvqyNkUia3/qm47frwUIVyXxNGVySDE8PpHezXVmbBwj3yAgp0RxBG7aH4kAk5CLJPz0dZBexw7yNtrY2Xvc+w0LOQhf75NHWNZNm4WoT65vZBIwWKThg0Afxine/2EHrNjYRPmI4MrF6vY5qcRqB3BgtnL+N18z+41XwTu8O30iA0AFBiLaDsjwuZ/1ALs71z29XZP9CPErUC57CtrDdsBsXElFXvUx6zl2FjXdxdvwh/Tl8S1AQmByYxUBqM33ESt9LYrq5VX1p57y2zJoCfiz+Z/8QH5g9w4kRGQVdQhO7gIYTdmWz7u4/OyUHqRnzNvW+35rtrFppZJC9isbiY983vc0I6wfPWZxgU04G7el1yxv/DolpI9+wgOgoqLEV0qx6Pf28/bruiA08NGk+oTeDggVMh43GmmfxjdgPVupPt6qqsEHC0SPi8p5pWQSFIEPUczMh3TnsBx3THyJfyyVAz2G3bTX95EDef0BHe2EQpCWzd2kT0u5tZVv4NY04kce/Av6N3tcbre+l78Zn+M24038gUeQoLvAsw88O/zKASZJF0O6GNejq8O4ERE3zMDk3EHB4gKgoOlonsyzLRp7+PS02TmbAplNWzMriXkQQIEhT8GHw29mWY6N8fHPUSUic/aVIa5bpysoVsbgneQrKcTIQScXEK4NB+A+HhKonJgZ+8VkHhPcN7DFBSucl3A4XiCT40fEhyoInkSCNvVC4kNOU9DsS3cP+iAFe7+1E/49RiTWogFb/qx2PwsMC7gA5qh58OJhkgPsKAuLEnMf2dWDq4ARg8wk1NjYUd28xIokhdrQ9f4UJ2vdCdkiF76XZdOsVCMfKH99F7UiIOWz07mv2s6f4UkUIUBsVAuBrOK4ZXMGPm4cDDdPN3Q0VFQPhpF7egGH9UBGpY6PktgG2bjDQ0wBPP/rQAsvXZWAQryWsOk9RFT6fEy2gQ6nk7eQEV8X+hZ3wN7ybt5LIsC1evEAn8sf2p3+HB4aQGUzFwlpMyAUZd7iPnoJ4hw07vmGkz3eQfC/LZUjNGQSSpLIz3Zn5K46E7MQ2OoigqHzXsKJkRX9LSIrC/Io4OQw084H2A2GAsKirlunLWGNcwWz+bDcIGYnwxP/mVLLVNhAwcjvcvT9D8wN3t9jec8wKQkZGQKC/VceSQkSumygguJ2J5FUpiAqrZ1N4cC0FW6FZwkMO89VQstXM203L99YyouYoty4s5On8A+XVViLM/4v5Prkfn24ErdeAZ+lM4+87/p8cQGeSxJ5rOWNa9p5/f/VlGb5Tx/b6aPl/m0HD3CKq/uoKHrrqd9X7oFyGzNXInwRWTeXDiTad9l8RgItOUaYgmkZm6mSxWF9Pb3/60kqpCY50evyDTNWMnKiDu2An33AJG0/k1CdyhS+cV9W12rzczbFiQA7kC0hNvEXX5ZAy7sk5/8ICH/boDvG98nxNSAYsrnufbrAYWvyjw0WILmZ+5SFlTzr6kN9n7yF957P5G4t5aCagoQwb/KlZMb2yNLYQPSGbaqnJi9UbscQLLV4dwsthGnz4K8xNHEFQkdm5tb7ITlUSu9V7LLfItPKd/jlyp/cFTQYC/v2rjzVciOLKsCAEwHMulIq+1/Gw3tP5HBZCbY6JJamKN4ROWfiyxOPlvdBlWS4cYhcyl5eByYyg4yqovjGxZG8KKbc2MDZ3CBuNasqQsLlFSCb52jKXMI7pyN3ODq5lt/JSH2E94r0PEKV2ZWtQPtbQYtUsX/Cb9rzmaocbEgM3GpQ0bKGswsDlNZNgoDyoqepvKhMkBMjMkREGkuFBH7hEJv6+14yKUCOb55mHCxCbDprY6C6VC7jHfxhcfRBLbUeXycR4ycmOQkXAUN+I8VMfVUyOpqzYi/0zHFCTgcYBFv1/087WOIjFqsB2/tZl1H3VioLEHoaKNzbPvxVdWimuDlR7xu3E3dMA/aTrr19nIi1pPy+PhjO14GffF3sw49xW8fFMp13XYzpQ+lcSufhdzcxNSbEdCb7yXm5TbCT1ahn7vPoTLLsN19ZW/qgAEjxfDmvUY31tM0oaldIwIMO7WaGSLEUSRpiaRELOO99+y4mwMIPgMLFtmpaTAQLhdpWO4ngQlgcWG9+ikJqEPGHjb/DY7duo4khbFbxdKOBpshL36Eo6ufZHjE/hkezJTHu3Gjm16EpIUwuz/ngpeeOaFf37c/YsIIHu3mRkzg7ynLuG6a1VKX7+SxX81Y1Pt+N44wcqZFey8009pwEzx8ZsZen8223UbuHzLEfh8GEXmS9ixTqHH5rcZMzcE7rsJw/sfIZSWEpg2gbiJd2PFht7pQv/1N7hvnod/2OBfVQCKPQxlyGDUrl2xW730P/EV5udfxphXAKqC7vgxXOv3EJq5hXFrf0/IltX0uXMw2ZXR1FWKREVCj9BoGur0PLFzO3szLaS/l8KEyhvQz1rD9h5LuCJa4t3lNuqGdGK/5zIqx+3nnoXdKGxwUXciioQuXgz/sqPNjx/pJ7aufV8Abe8LePVNN3Nuavn/m0YFDuwI4cGMlQx9YgUPehfRKdgFVZCRvD5KLn+Qj53TCV/SzMY3jyCPGkfCfcuIXbaNP92g4BfspP1pFcETlUxeegvGla/jGTeGqCvnIuzYieud13Ff23rKVzpZT8iKNTinTSQYH/sf86UFBKSiEszb0jF/8BGUlSGIAogqamISvpHDMX2wFDnSTsub77LCPRx3vY6YWD+NTUH+enwVl4xv4KqmG7hiLOQ6K3i1w5NUCw70HxaT9s3nXNOUzaplC5kUOpnwQCLeRU9y5ywT5VUSU2e4ECVIM6SRKWTyW99vf1QE30sX/z9tAnjjbQcDLgnQrefZLXB89ZmVcZP8mEwKJsspU9TshFufKabPwm9J6ubmLs+CU/7s7izCrpnLopR16Hr2ZGfNF/jfeB9dbICls90k+uLRpaXju/NOxOoq9Bs2Ut9QgazKmIsrsA0cStO+XacSPf5zG8/P7Br9++pXIRD4LqnUd99JFMGgR19YQsTEK1sbe9JEXq+eTXWtgP2OSaTctIOBxl4YldM9FvNLL2F46jnq0jKQKiux3ziHPa/dwNI7bGwpy2H8+ucZG5PCsrdsTHhzLU8l3c0oZTTPu5/HivW0upqkJp4y/DdxB6bzt8Ft3sn/tLmB+yx7qG0QCJGiiJDDKc61UVWhZ/R4Z1v7+pQgLn+AwsM2tmXIHM6xMnKEyvE8gWkzXIQmFPHi6t1Iccm4u+3nLs/Lp/ucWXsRvH6mP96TpR9KPLz5EOVf1LHnpu50TT+A88MnkDp3xrRkCaqqol51JbLaKi5P53j0f3iUYJfOtL3k5Fzp+O9P3w1ndjsDXZJo2LaOsNk3wKZN3Cutw18voyzugWfUqwRT2t9nOngcnSxiGdAdtWsMeoOFEZ9WET93Kclx/+CrO++m6vBUDPN78O6OWq5OmM02cRt7TbsoeHE2o8f4iepdzXLzcg5KB8hUM0mo6X/mOIDX3MDnNUfZGdjPDPMoWtb8hp17BAYMdhMWrtCktrC9Lp8lSyQUXQDTb9ZjcvRBFcYyREzk7xtryFV3UetQeHCWibmel0+LdAkuF8aNWwmOHIm9l55uqRYi9rQw47MYmgYtBPPd+Pv1xj+gH/ZvViM0NNBy582nfVnHw785J+PpZ0sgMZ7G9A0ITlerS7nvALb/egTz5Om4nvgjrpuv+557JiAUFCKkpBCQA2A2IfTqDQf3Eerycjt30kvXh419VrOqvI4Rzmu48dBdjOy3jE8PltCyQ6HM56B+yJ8JF+z0Dw7ggfJn+a+N1Wd2Ax8eOowrch5hiDKYJV8KHI/JYPoUH888FoEiuniy6mOefjHAkF4W7rnXy+xePdh36WtsH/4Cn8y4hxXDniU0ez/zPrEyTe7YNja24Xajz9pD4Pp5REcGmDu/hYGjTKhHsgn94DMCnRMI2qwEOkQSmHoFxMbiG3r64o16AbzeSDYZCUZFEIyKwDNpHE0Z30JiIpann0f/vUwkQkUlYn0DwZHDTzXhnbcg1ddjXLkKgBHBETzs+QPLx9xKbO5EasolbEdHUVgaILqThxOG45TmWVjgWsAdnrvY+UUCd13S58wC6BCqp3t3mcaHH8ZbFca+zl9xdOprSPO+IvmBnWz6OJprh8fyu4m9uUI/mmu9c9ji3EaFUEm9oYnHK/fz6hcZPFG4gI7Hs9o9uG3rTrBYcA8ZiE4Cm05FN6h369HrZV+gjhgOoaGg0+GeOQ153BhU6cI7iNHOKoRYcbz1CmJVFebPl5/yz2tqERsa8Q44tXfBNXcWakICpi+/RnS521YyO8vduHV+A8s+DqHy2+5E7ZvI5892o653Ov2+/gN2TwzLPwlBb1QZPkI5swBECS5PrUPK3Ml/p8zlkpFumrvsparbDuYOS+bJrtfzyMwkBMPpiZMXO99nQc2VPLCglJQUH8LYkVjeeb/9gsY77xHs2welQ3Tb37yDB4IkgdGI95IBqGKrxQgMHYxj0W/OvTH+F8LTqzvyvHmY/v4PpNq6NgEgy6gjT09w4Xzij+j2HUB//PQtafEJMtOudpCbp7JwdjxxoUam945gkD2OPz8agSCJjJjspEOs/4cjgXEFO3mleh6p4h4eEe7nLvd9vBA/n+dm92LW1f4fWj9h4gd1iE3NeN54Hfc1MxH27sNYXnUqfNrYgnjwEIHhQ057O5c8oH/rrNlkItivz2k+tq9b54tGAEDrq2ocDqzvLW3tmPoGBJ0Ob9fTU9v7JoxBtVoJff2ddnVMnOLhnodbGBus49kba3n0nk+RdmWRUyQxLTaTAV+9jCn74A8sBgWDWLZtRzpZTdJ9t1OXk0mUEolO1BE5ajTuBXfhuO369rHkhkbMy5ahjh+Pc/glGEKsYDRifuMdfM/8d6uZ+nw5KAqBy0edPh5KAq5nn0INBpB797ygkzL/FP6e3fFdOwvzcy9gWrEKtbISevVC/Zfj7XJ4KL47bsH0xNPonnmcYMeo08qj7Cqhtz3CDVtAiDjODZun0FMYSmLaTlAU5Icf/IEhwOFEt3I1crduCEVFWF98HQD7xKsgNxfzQ48S/sifEevqT/dVt6Yj5uXjfPg3rQ/SpwfBgf0xvL8EndCqL/0HS1FjY/CPap+vx7XwTtwPLEC5iDu/1eaLeG69kcDgSwjqROROcXh/ILrpmTIBwsMI+c3D7crMOzMR0nYQvOsOakpyke65keHDnAT+6wGCvXpgKyg9swUwZh9AdLtp/vJjbIt+j/HNt9FnZSPu2oXrb38FfwDr088RsWMXjrdexde/N8aCYqz3Pkhg/Fjcg08tx/pvuA7dtm8Jvete/JMnIOTlE7x+LrKIxo9ZgaGpNGz+5qcnjr164L9qOsYPlmLO3ItnWOteCMHnx7h4CWJ0NA1P/aE1APS3v7TdZ6+oQN2V2W4IVwGCl41G9XpoXPEpereX8MGjUJubkZ96gvoH54OqYjici/3Ka1GNRlxffIzltrtRT56kees6At2ST6s48vHn0L31DorXiyDLONM24x7UV+vlnwmd20tEcm/ky0bRuGwJigCGvELsQ0bhfe1lmm+e094Te/wZrK+8gXDqDSj/c2oISEvHN34MSmgIvphoPA8sRLlyOvX339kW5fL3601D2kYArCPHIuTl4/nL4+06H6D+8UdpPH6QwNxrELp21Tr/ZyZoMeF/dBG6jCz06bvQF5YQftd9qD174ph25sxoQlJSq9d1Jgsg22y0bF6Dr0/rGzVEtwdBVpBDrO0qMhw5RvjsG5CHD6Xhg7d+MkCjb3YSCLNpvfZzTxuCClEDhiPbw5Hy8pE7RON66Tk8E8ee8XrL1nSs825BcrvbrwUIyZ3bOh9AsfzwDlp/n540fv0pcmLCWUXntM7/haKKOhH3ow9hfuC3BOfOoelPDyN3ivvRULRq0IP7DBagvjSPgD1Ua9XzzQrU1qEvLcc7sC/ofnyLpz4gE5YyAF1dXXsLoHX+eWoFOkQhd4g6q2sDegk1PAxOCQDNMbvIEPr1O3MgSOMi8R5SumkCuJjx9eutCeBiRu2jCeDitgDJiZoALmoL8C+ri5oALnI0AWgC0NAEoKEJQEMTwK+Kx+OhqrKK5sZm1q9eT0Z6Bk0NTWxYvYGKsgr8Pj8b126kuKCY+pP1bFi9AUeLg/qT9axbtQ6P23PGeutP1rNp3SYEBERBZNPaTdT/yza2qsoqcg/nosoqu9J2AVBe/OPvBDqQfYCW5hYydmRQmHfmNLGCKrDum3U0NTRRW1MLwJGcIzTUN5C1O4uc/TnnnAD+Y0mimuqbWPXFKm6/73aGXTqM2upa1q9az3W3XkdxQTEbvtnAtKunsS9rHy0NLUycOpHtm7Zjs9mYPH0y+zL2MWjYILJ2ZiEKIsNGDwNgd9pups+eTnZWNo4WBxOnTmT9yvWYrCa6dO1CXEIc1RXV1NXUUV5STr+B/cjYkcHK5St55qVnqK2qpbKykpiYGFxOF117dAWgIK+AohNFjJkwhqyMLLqkdGHrxq04WhzMuGYGAEdzjpI6OJXCvEKWf76cp196msqSSvSSnrUr13LH/Dvant+6ah3qWb6V3P27315YAlBVldwjuZSXl1NbWYstzIaiKIRHhHMg+wB5x/KIT4gnNyeXDas3MOeGOTTUNWAxWdAb9aRvSae6uprO3Ttjtpg5cugIiqJQXV2NoAosfWcp8cnx9O3XlyVvL6HwRCFxCXHU1dYRciQEi8UCIugkHau+WsWU6VMYMWoEABXlFeTn5rNpzSYGpA4g/dt0xk4YS+buTCZNncT6b9azf+9+Jk+fTDAQxOVykXs4l11pu5g1ZxY5B3MoPF6IyWIiOyObupo6GhsamXXtLDJ2ZJCQnACAZdsO+OqrHzxL+GsJoG0/QLWj+lcVQUVpBfEJ8ZQUl5CUnERjQyNetxeH04HJaCIkJIT6+noUWSEiKoKa6hr0ej2hYaG4HC4UFEJCQyjMKyQyKhJ7hB2vz4vJYKKhsYG4TnEoQYXqqmpCw0LxeDyEhoYSHRNNTVUNzY3NhIaH4mhxEBsfS211LZ0SO5GXm4fZYqa2ppbUoalUlFUQ3TGaksISOsZ2pLmpGVEUkSQJWZaRFZmo6Cjq6+oxGAz4vX6iO0bj9XrpENOBkoISwuxhVJZXEhIWQkJSqwB09Y3gcp3V2YdgQvzP2vbfPx7+q1mAuto60ramMW3WNDat3YTRaCTcHk7+sXzKS8sZedlIDhUfov8l/Sk4XsD2LduZNXcWJ46fYG/WXsZNHode3z4NTFlxGW6Xmx59elBcWMzRI0cZM3FMW3l4ZDiH9h/CarMSHRPN4UOHiYiIwOV2kdI7hZjvXgxp++7ASp/+fWhpaWH/3v306deHE/knSEhIIPdoLm6Pm9ShqYhi+6mT3+cnLCyMNavWMHTEUOTvcrjU1ddhNBsxGow01je2CSAYaYdI+8UzB9ixaQdXzrmS+tp6PG4PqUNT2bhmI4OHDEZn0pGRnsHuHbvp1bcXNRU1jJs8jvxj+Zw4doI+A/qgyApe2cuqL1Yxetxo7JF26mrrsNvtHDpwiEFDB2E2mqmprsHV7GL9mvVcNv4y7BF2SgpK6JrSlU8Xf4ov6GPwkMFUlVUxaPAgyovLKSwoxGwx069/P0xWE2UFZVx19VV8tuQzRl42kq2btjL1qqkU5hUiiiKfL/mcjnEdGTJ8CJJOoqW5hXWr19Gvbz8C3gAmo4lnH3+Wv77yV+qq6zAajGxev5nUwadS2S03LqdRbUREJJJIDnCAoQxlN7sZwhAqqMCMmTDCmOmfef4LQG/Sk3s4l4iICMpKyji07xDxneLZv28/zhYnOr2OpK5JrFmxhsjISLZv2o4kSQiCQGV5JRGREaio+Pw+9mfup76xnqioKFRZJSM9g/FXjKeosIigP0ja9jRqKmsoLiimoa6BQDDAyZqTmGwmSo6W4HA48Pq8NNQ30NTYRNrmNGwhNvQGPUdzjhIfH8/iNxczcsxIqiqrMFvN7Nm5h0HDBuFyupCDMik9U/h86efo9DqunXct/Qb0w2a10aVbF9atXEdcQhwFeQV4fV58fh82q42qylPH5UrFUqqEKiQk3LjZz37iiGMf+4ghhnzysWEjmmj4BZOS/2pzgObGZhwOBxGREQSCAcLCwtrcM1FoNan2SDulxaWEhYW1JohQ1dZO9/roENMBr8fLpnWbGD95PF6PF71ej6RrHYsFQSAYDKKqKmazGWeLk4joCPR6PSerT2I0GwkNC6W5qRmdXofX7cXv8+P3+7HZbHi8ntZ5hNeLs8VJaHgoer0el8tFZGQkLc0tREVHcXDvQeKT4rHarDQ3NiMIAhFREXi9XgQEHC0Owu3hyIqMxWLhZM1JbCE2fF4fKir2iFaz7xbcKCjf+eIifvwYMeLDhwEDMnKrK4uIRbX8YnOAX1QAjQ2NbFq7ialXTqWqqoqIqAjCwsPITM+kxdHC2PFj2bJpC1arldFjR7Nn9x6Gjx7O0ZyjHNp/iOtuvo4jB49QeKKQSdMnYTS2f8dfdmY2HqeH0eNHk388n+ITxUycNvG0a7J2ZREZHUlpUSlms7nt8/gp43/wux87coy4TnFsWL2B6TOms3vnbrr36E5C54T2Xo2iUlZSRqekTuQfz6djx46kb0tH0klYrVbiYuPIPZZLIBBg2lXTMFlM/9Fx//sC+GXSxH3Hzu07mXHNDMpKy8ja3eqvHz9ynJQez1wLzgAAAv1JREFUKcQlxJGdmU3Pnj0Jt4eTsz+H9G3ppA5JpaSghKGXDqXoRBFlJWWkDkvFZDIRCAZY9cUqTGYTsizjcXsw6UwcOXyEvgP7IqgCB/cepGPHjnyz/BvC7eGtnZlzDLPZTHh4OAf2HiAqMoqq0ip6DehFWVEZ6dvSqa6qxh5ux+V24ff5+ccb/2DCpAmEhISQeziXkuIS7HY7HWM78sn7n9DS3ILBYMDr9eLxeNiyYQs9e/bkjZffYMpVU7CYLZjNZqrLqhF1ImMnjqW8qJye/XoC8OE7ocgBicMHdez61srxowa8bj3794nsTrNRUqjD1WwiO1ugRy/5Z+2X72cJ+0XnABaLhQ1rNhCfGI/T4aSxsRF7uJ3jx45TUlxCYlIiWRlZ+L1+zBYzYyeN5ctPvqRTQie2btja1tHZGdmMmTAGFZXq6mryjuRxsu4kEREROFuciKJIWWkZzmYn5eXlHD18lOaGZpobW1225uZmbI02nA4ndSfrcLQ4aGxspLK8ktraWo7lHEOQBELDQjm07xBzbppD3/59cbvdpG1NI3VIKmu/WUvnLp05efIkgiDQuUtn1q5c2zYHSOmVgmSQGDR4EACZOzO55sZryPg2gxB7CCuXrWTC1AnfG3slQD4tICsAAiKCKiIgAiKq8ssekf9Fh4BgIIjX68VkMiErMjqdDkEQ8Lg9CGJrqFZRFARBQBRFjCYjTocTvV6PoiiIooiqqgSDQSxWC16vl+yMbC697FKCgWDbuC9KrX65qrReazQaCQQCGI1GREnE7XIjSRLBYOs9Or0ORVZwOVwEg0HCI8Lb7gsGgxhNRnxeH3q9Hq/Xi9FoxOvzYtQbKcwvpHP3zuh0Ovw+P4IgtN4nB1uv93gxmU1tz+1xe5B0EsFA6zOcapvWBGKq+l2yM6E1JKCq3/XId/9GBUn3yw0BujP8UUNbDNLQBKBxMWAVAJPWDhclAhDQmkFDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0ND4wLjfwE9VJhuBfJALAAAAABJRU5ErkJggg==" alt="CentriMo Logo">
        <h1>CentriMo</h1>
        <h2>Local Motif Enrichment Analysis</h2>
      </div>
      <p>
        For further information on how to interpret these results please access
        <a href="http://meme-suite.org/doc/centrimo-output-format.html">http://meme-suite.org/doc/centrimo-output-format.html</a>.</br>
        To get a copy of the MEME software please access 
        <a href="http://meme-suite.org">http://meme-suite.org</a>. 
      </p>
      <p>If you use CentriMo in your research, please cite the following paper:<br />
        <span class="citation">
          Timothy L. Bailey and Philip Machanick, 
          &quot;Inferring direct DNA binding from ChIP-seq&quot;, 
          <i>Nucleic Acids Research</i>, <b>40</b>:e128, 2012.
          <a href="http://nar.oxfordjournals.org/content/40/17/e128">[full text]</a>
        </span>
      </p>
    </div>
    <!-- navigation -->
    <div class="pad2">
      <a class="jump" href="#graph_sec">Motif Probability Graph</a>
      &nbsp;&nbsp;|&nbsp;&nbsp;
      <a class="jump" href="#data_sec">Enriched Motifs</a>
      &nbsp;&nbsp;|&nbsp;&nbsp;
      <a class="jump" href="#inputs">Input Files</a>
      &nbsp;&nbsp;|&nbsp;&nbsp;
      <a class="jump" href="#info_sec">Program information</a>
      &nbsp;&nbsp;|&nbsp;&nbsp;
      <a class="jump" href="centrimo.tsv">Results in TSV Format</a>&nbsp;<span id="results_help"></span>&nbsp;<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAQCAMAAAAyEe/dAAAACVBMVEX//wAAAAD////s2cV/AAAAdUlEQVQYlXVRBxLAIAhL+P+jC2HZhXcBZEWEldDsZcLIcAhHWWnK8SDcWQhMFUHdAQ1CqQ5+CWPmlHojl+nCJNRtzu4qRc3IUzmTVpXYK0nox0z0PI1stgchdK7lEv7ekhvalw8WW547Gyzedt/2/gLx8WXjXF/1AYFriNAWAAAAAElFTkSuQmCC" alt="NEW" id="new_1">
      &nbsp;&nbsp;|&nbsp;&nbsp;
      <a class="jump" href="site_counts.txt">Sequence position vs. number of matches for each motif</a>&nbsp;<span id="sites_help"></span>&nbsp;<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAQCAMAAAAyEe/dAAAACVBMVEX//wAAAAD////s2cV/AAAAdUlEQVQYlXVRBxLAIAhL+P+jC2HZhXcBZEWEldDsZcLIcAhHWWnK8SDcWQhMFUHdAQ1CqQ5+CWPmlHojl+nCJNRtzu4qRc3IUzmTVpXYK0nox0z0PI1stgchdK7lEv7ekhvalw8WW547Gyzedt/2/gLx8WXjXF/1AYFriNAWAAAAAElFTkSuQmCC" alt="NEW" id="new_2">
      <script>
        make_help_button($("results_help"), "pop_results");
        make_help_button($("sites_help"), "pop_sites");
      </script>
    </div>
    <!-- alert the user when their browser is not up to the task -->
    <noscript><h1 style="color:red">Javascript is required to view these results!</h1></noscript>
    <h1 id="html5_warning" style="color:red; display:none;">Your browser does not support canvas!</h1>
    <script>
      if (!window.HTMLCanvasElement) $("html5_warning").style.display = "block";
    </script>
    <h2 class="mainh pad2">Results</h2>
    <div class="box">
      <span id="ins_desc"></span>
      <!-- write out the job description -->
      <script>
        if (data['job_description']) {
          var node = $("ins_desc");
          while (node.firstChild) node.removeChild(node.firstChild);
          var header = document.createElement("h4");
          header.id = "description";
          header.appendChild(document.createTextNode("Description"));
          node.appendChild(header);
          var paragraphs = data['job_description'].split("\n\n");
          for (var i = 0; i < paragraphs.length; i++) {
            var p = document.createElement("p");
            var lines = paragraphs[i].split("\n");
            for (var j = 0; j < lines.length; j++) {
              if (j != 0) p.appendChild(document.createElement('br'));
              p.appendChild(document.createTextNode(lines[j]));
            }
            node.appendChild(p);
          }
        }
      </script>
      <div>
        <div style="float:left; width:70%">
          <h4 id="graph_sec">Motif Probability Graph 
            (<span id="ins_score2"></span>)&nbsp;
            <div class="help" onclick="help_popup(this, 'pop_prob_graph')"></div>
          </h4>
          <script>
            var compare1 = (data['options']['use_pvalues']) ? "motif <i>p</i>-value &le; " : "motif score &ge; ";
	    var score = (data['options']['optimize_score']) ? "optimal Score Threshold for given motif" : data['options']['score'];
            var compare2 = (data['options']['use_pvalues']) ? " &le; " : " &ge; ";
            var thresh = data['options']['score'];
            $("ins_score2").innerHTML = compare1 + score + (data['options']['optimize_score'] ? compare2 + thresh : "");
          </script>
          <div class="graph_box">
            <div id="pop_peak" class="pop_graph_peak"></div>
            <canvas id="graph" width="700" height="400"></canvas>
          </div>
        </div>
        <div class="graph_options_section">
          <h4 id="graph_sec">Options</h4>
          <h5>Plotting&nbsp;<div class="help" onclick="help_popup(this, 'pop_plotting')"></div></h5>
          <div style="max-height:200px; min-height:100px; overflow-y: auto;">
            <table class="graph_list" id="graph_list"><tbody></tbody></table>
          </div>
          <div id="unused_colours_section">
            <h5>Unused Colors&nbsp;<div class="help" onclick="help_popup(this, 'pop_unused_colours')"></div></h5>
            <span id="unused_colours"></span>
          </div>
          <h5>Graph&nbsp;<div class="help" onclick="help_popup(this, 'pop_graph')"></div></h5>
          <div>
            <label for="plot_type">Smoothing:</label>
            <!-- <select id="plot_type" onchange="recreate_table=true; make_MP_graph(); recreate_table=false">-->
            <select id="plot_type" onchange="make_MP_graph('smoothing');">
              <option value="0">Moving Average</option>
              <option value="1" selected>Weighted Moving Average</option>
            </select>
          </div>
          <div>
            <label for="windo">Window:</label>
            <input type="number" style="min-width:40px;" id="windo" 
            onkeypress="num_keys(event)"
            onchange="make_MP_graph('window'); get_central_probability(); make_CEM_table()" value="20" size="2" step="1" min="1">
            <!-- onchange="recreate_table=true; make_MP_graph(); recreate_table=false" value="20" size="2" step="1" min="1"> -->
          </div>
          <div>
            <label for="legend">Legend:</label>
            <select id="legend" onchange="make_MP_graph('legend')">
              <option value="0">Disabled</option>
              <option value="1" selected>Enabled (click on graph to move)</option>
            </select>
          </div>
          <div>
            <label for="plot_distance">X-axis:</label>
            <select id="plot_distance" onchange="make_MP_graph('x-axis')">
              <option value="0">Position of Best Site in Sequence</option>
              <option value="1">Distance of Best Site from Sequence Center</option>
            </select>
          </div>
          <div id="CB_show_plot_negative">
            <label for="plot_negative">Negative sequences:</label>
            <select id="plot_negative" onchange="make_MP_graph('plot-negative')">
              <option value="0">Not plotted</option>
              <option value="1" selected>Plotted as dashed line</option>
            </select>
          </div>
          <div>
            <label>Zoom:</label>
            <input type="button" id="zoom_out" value="Undo Zoom"/>
            <input type="button" id="zoom_center" value="Center on 0"/>
          </div>
          <div style="margin-top:10px;"> 
            <form id="eps_form" method="post" action="">
              <script>$("eps_form").action = site_url + "/utilities/save_generated_file";</script>
              <input type="hidden" name="name" value="centrimo.eps">
              <input type="hidden" name="mime_type" value="application/postscript">
              <input type="hidden" id="eps_content" name="content" value="">
              <input type="submit" onclick="download_eps()" value="Download EPS (for publication)">
            </form>
          </div>
        </div>
      </div>
      <div>
        <div style="float:left; width:70%">
          <h4 id="data_sec">Enriched motifs (<i>E</i>-value &le; 
            <span id="ins_ethresh"></span> using 
            <span id="ins_test"></span> )
          </h4>
          <script>
            $("ins_ethresh").innerHTML = data['options']["ethresh"];
            $("ins_test").innerHTML = (data['options']['cd'] ? "the cumulative Bates distribution" : ((data['options']['disc']) ? "Fisher's exact test" : "the binomial test"));
          </script>
          <table class="motifs hide_db hide_maxprob hide_tsites" id="motifs">
            <thead>
            <tr align="center">
              <th class="deselect" onclick="clear_selection()" 
                title="clear selection">&#x2612;</th>
              <th class="col_db">Database&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_db')"></div></th>
              <th class='col_id'>ID&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_id')"></div></th>
              <th class="col_name">Alt ID&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_name')"></div></th>
              <th class="col_consensus">Consensus&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_consensus')"></div></th>
              <th class="col_concentration">Concentration&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_concentration')"></div>&nbsp;<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAQCAMAAAAyEe/dAAAACVBMVEX//wAAAAD////s2cV/AAAAdUlEQVQYlXVRBxLAIAhL+P+jC2HZhXcBZEWEldDsZcLIcAhHWWnK8SDcWQhMFUHdAQ1CqQ5+CWPmlHojl+nCJNRtzu4qRc3IUzmTVpXYK0nox0z0PI1stgchdK7lEv7ekhvalw8WW547Gyzedt/2/gLx8WXjXF/1AYFriNAWAAAAAElFTkSuQmCC" alt="NEW" id="new_3"></th>
              <th class='col_evalue'><i>E</i>-value&nbsp;<div class="help" 
                    onclick="help_popup(this, 'pop_evalue')"></div></th>
              <th class='col_fisherpv'>Fisher <i>E</i>-value&nbsp;<div class="help" 
                    onclick="help_popup(this, 'pop_fisherpv')"></div></th>
              <th class="col_pvalue"><i>p</i>-value&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_pvalue')"></div></th>
              <th class="col_negative_binomial">Negative <i>p</i>-value&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_negative_binomial')"></div></th>
              <th class="col_MCC">MCC&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_MCC')"></div></th>
              <th class="col_blocation">Region Center&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_bin_location')"></div></th>
              <th class='col_bwidth'>Region Width&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_binw')"></div></th>
              <th class="col_bsites">Region Matches&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_bin_sites')"></div></th>
              <th class="col_tsites">Sequence Matches&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_total_sites')"></div></th>
              <th class="col_negbsites">Negative Region Matches&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_neg_bin_sites')"></div></th>
              <th class="col_negtsites">Negative Sequence Matches&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_neg_total_sites')"></div></th>
              <th class="col_maxprob">Max Probability&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_prob')"></div></th>
              <th class="col_problocation">Max Probability Location&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_problocation')"></div></th>
              <th class="col_nbinstested">Multiple Tests&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_nbinstested')"></div></th>
              <th class="col_score">Score Threshold&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_score')"></div></th>
              <th class="col_OEbins">Other Regions&nbsp;<div class="help" 
                  onclick="help_popup(this, 'pop_OEbins')"></div></th>
            </tr>
            </thead>
            <tbody>
            </tbody>
          </table>
        </div>
        <div style="float:right; width:30%">
          <div id="seq_area">
            <h4>Matching sequences (out of <span id="ins_seqN"></span>) 
              <div class="help" onclick="help_popup(this, 'pop_SMmotifs')"></div></h4>
            <script>$("ins_seqN").innerHTML = data['sequence_db']['count'];</script>
            <h5>Union: <span id="matching_union_number">0</span> sequences 
              (<span id="matching_union_percentage">0</span>%).</h5>
            <h5>Intersection: <span id="matching_intersection_number">0</span>
              sequences (<span id="matching_intersection_percentage">0</span>%).</h5>
                    <textarea id="matching_intersection_sequences" rows="10" cols="50" readonly></textarea>
                    </div>
          <h4>Filter &amp; Sort</h4>
          <h5>Filters&nbsp;<div style="margin-top:5px;" class="help" 
              onclick="help_popup(this, 'pop_filtering')" ></div></h5>
          <div id="filters">
            <div >
              <input type="checkbox" id="filter_on_top" value="1" 
              onclick="toggle_filter(this, 'filter_top')">
              <label for="filter_top" 
                onclick="enable_filter('filter_on_top', 'filter_top')">Top</label>
              <input type="number" id="filter_top" value="10" size="4" min="1" step="1"
              onkeypress="num_keys(event); update_filter(event)" disabled>
            </div>
            <div >
              <input type="checkbox" id="filter_on_db" value="1" 
              onclick="toggle_filter(this, 'filter_db')">
              <label for="filter_db" 
                onclick="enable_filter('filter_on_db', 'filter_db')"
                >Database is</label>
              <select id="filter_db" disabled>
                <script>
                  var filter_db = $("filter_db");
                  filter_db.options.length = 0;
                  for (var i = 0; i < data['motif_dbs'].length; i++) {
                    var db = data['motif_dbs'][i];
                    filter_db.add(new Option(db['name'], i));
                  }
                </script> 
              </select>
            </div>
            <div >
              <input type="checkbox" id="filter_on_id" value="1" 
              onclick="toggle_filter(this, 'filter_id')">
              <label for="filter_id" 
                onclick="enable_filter('filter_on_id', 'filter_id')"
                >ID matches</label>
              <input type="text" id="filter_id" value=".*" size="12" 
              onkeypress="update_filter(event)" disabled>
            </div>
            <div >
              <input type="checkbox" id="filter_on_alt" value="1" 
              onclick="toggle_filter(this, 'filter_alt')">
              <label for="filter_alt"
                onclick="enable_filter('filter_on_alt', 'filter_alt')"
                >Alt ID matches</label>
              <input type="text" id="filter_alt" value=".*" size="12" 
              onkeypress="update_filter(event)" disabled>
            </div>
            <div >
              <input type="checkbox" id="filter_on_evalue" value="1" 
              onclick="toggle_filter(this, 'filter_evalue')">
              <label for="filter_evalue"
                onclick="enable_filter('filter_on_evalue', 'filter_evalue')"
                ><i>E</i>-value &le;</label>
              <input type="text" id="filter_evalue" value="1" size="7" 
              onkeypress="update_filter(event)" disabled>
            </div>
            <div id='cb_filter_on_fisherpv' >
              <input type="checkbox" id="filter_on_fisherpv" value="1" 
              onclick="toggle_filter(this, 'filter_fisherpv')">
              <label for="filter_fisherpv"
                onclick="enable_filter('filter_on_fisherpv', 'filter_fisherpv')"
                >Fisher <i>E</i>-value&le;</label>
              <input type="text" id="filter_fisherpv" value="1" size="7" 
              onkeypress="update_filter(event)" disabled>
            </div>
            <div >
              <input type="checkbox" id="filter_on_binwidth" value="1" 
              onclick="toggle_filter(this, 'filter_binwidth')">
              <label for="filter_binwidth"
                onclick="enable_filter('filter_on_binwidth', 'filter_binwidth')"
                >Region Width &le;</label>
              <input type="number" id="filter_binwidth" value="200" size="7" 
              min="1" onkeypress="num_keys(event); update_filter(event)" disabled>
            </div>
            <div id='CB_filter_on_negbintest'>
              <input type="checkbox" id="filter_on_negbintest" value="1" 
              onclick="toggle_filter(this, 'filter_negbintest')">
              <label for="filter_negbintest"
                onclick="enable_filter('filter_on_negbintest', 'filter_negbintest')"
                >Negative set <i>E</i>-value &ge;</label>
              <input type="text" id="filter_negbintest" value="1" size="7" 
              onkeypress="update_filter(event)" disabled>
            </div>
          </div>
          <div style="margin: 5px 0;">
            <h5>Sort&nbsp;<div class="help"
                onclick="help_popup(this, 'pop_sorting')"></div></h5>
            <div>
              <label for="motif_sort">Motifs:&nbsp;&nbsp; </label>
              <select id="motif_sort"></select>
            </div>
            <div id="box_peak_sort">
              <input type="checkbox" id="allow_peak_sort" value="1" 
              onclick="toggle_filter(this, 'peak_sort')">
              <label for="peak_sort" 
                onclick="enable_filter('allow_peak_sort', 'peak_sort')"
                >Regions: </label>
		          <select id="peak_sort" disabled></select>
            </div>
            <script>populate_sort_lists();</script>
          </div>
          <div>
            <input type="button" value="Update" onclick="make_CEM_table()">
          </div>
          <h4>Columns to display</h4>
          <div >
            <input type="checkbox" id="show_db" value="1" 
            onclick="toggle_column('hide_db')">
            <label for="show_db">Show Database</label>
          </div>
          <div >
            <input type="checkbox" id="show_id" value="1" 
            onclick="toggle_column('hide_id')" checked>
            <label for="show_id">Show ID</label>
          </div>
          <div >
            <input type="checkbox" id="show_name" value="1" 
            onclick="toggle_column('hide_name')" checked>
            <label for="show_name">Show Alt ID</label>
          </div>
          <div >
            <input type="checkbox" id="show_consensus" value="1" 
            onclick="toggle_column('hide_consensus')" checked>
            <label for="show_consensus">Show Consensus</label>
          </div>
          <div >
            <input type="checkbox" id="show_concentration" value="1" 
            onclick="toggle_column('hide_concentration')" checked>
            <label for="show_concentration">Show Concentration</label>
          </div>
          <div >
            <input type="checkbox" id="show_evalue" value="1" 
            onclick="toggle_column('hide_evalue')" checked>
            <label for="show_evalue">Show <i>E</i>-value</label>
          </div>
          <div >
            <input type="checkbox" id="show_pvalue" value="1" 
            onclick="toggle_column('hide_pvalue')">
            <label for="show_pvalue">Show <i>p</i>-value</label>
          </div>
          <div id='cb_show_fisherpv'>
            <input type="checkbox" id="show_fisherpv" value="1" 
            onclick="toggle_column('hide_fisherpv')" checked>
            <label for="show_fisherpv">Show Fisher <i>E</i>-value</label>
          </div>
          <div id='CB_show_MCC'>
            <input type="checkbox" id="show_MCC" value="1" 
            onclick="toggle_column('hide_MCC')">
            <label for="show_MCC">Show Matthew's Correlation Coefficient</label>
          </div>
          <div id='CB_show_blocation'>
            <input type="checkbox" id="show_blocation" value="1" 
            onclick="toggle_column('hide_blocation')" checked>
            <label for="show_blocation">Show Region Center</label>
          </div>
          <div >
            <input type="checkbox" id="show_bwidth" value="1" 
            onclick="toggle_column('hide_bwidth')" checked>
            <label for="show_bwidth">Show Region Width</label>
          </div>
          <div >
            <input type="checkbox" id="show_bsites" value="1" 
            onclick="toggle_column('hide_bsites')" checked>
            <label for="show_bsites">Show Region Matches</label>
          </div>
          <div >
            <input type="checkbox" id="show_tsites" value="1" 
            onclick="toggle_column('hide_tsites')">
            <label for="show_tsites">Show Sequence Matches</label>
          </div>
          <div id='CB_show_negative_binomial'>
            <input type="checkbox" id="show_negative_binomial" value="1" 
            onclick="toggle_column('hide_negative_binomial')">
            <label for="show_negative_binomial">Show Negative <i>p</i>-value</label>
          </div>
          <div id='CB_show_negbsites'>
            <input type="checkbox" id="show_negbsites" value="1" 
            onclick="toggle_column('hide_negbsites')" checked>
            <label for="show_negbsites">Show Negative Region Matches</label>
          </div>
          <div id='CB_show_negtsites'>
            <input type="checkbox" id="show_negtsites" value="1" 
            onclick="toggle_column('hide_negtsites')">
            <label for="show_negtsites">Show Negative Sequence Matches</label>
          </div>
          <div >
            <input type="checkbox" id="show_maxprob" value="1" 
            onclick="toggle_column('hide_maxprob')">
            <label for="show_maxprob">Show Max Probability</label>
          </div>
          <div >
            <input type="checkbox" id="show_hpeak" value="1" 
            onclick="toggle_column('hide_hpeak')">
            <label for="show_hpeak">Show Max Probability Location</label>
          </div>
          <div >
            <input type="checkbox" id="show_nbinstested" value="1" 
            onclick="toggle_column('hide_nbinstested')">
            <label for="show_nbinstested">Show Multiple Tests</label>
          </div>
          <div>
            <input type="checkbox" id="show_score" value="1" 
            onclick="toggle_column('hide_score')" checked>
            <label for="show_score">Show Score Threshold</label>
          </div>
        </div>
        <div style="clear:both"></div>
      </div>
    </div>
    <h2 id="inputs" class="mainh pad2">Input Files</h2>
    <div class="box">
      <h4>Alphabet</h4>
      <span id="bg_source"></span>
      <div class="pad" id="alpha_bg"></div>
      <script>
        $("bg_source").appendChild(make_background_source("Background source", data.options['bfile']));
        $("alpha_bg").appendChild(make_alpha_bg_table(centrimo_alphabet));
      </script>
      <h4>Sequences</h4>
      <table class="inputs">
        <tr><th>Database</th><th>Source</th><th>Sequence Count</th></tr>
        <tr>
          <td id="ins_seq_name"></td>
          <td id="ins_seq_source"></td>
          <td id="ins_seq_count"></td>
        </tr>
      </table>
      <script>
      {
        var db = data['sequence_db'];
        $("ins_seq_name").innerHTML = db['name'];
        $("ins_seq_source").innerHTML = db['source'];
        $("ins_seq_count").innerHTML = db['count'];
      }
      </script>
      <div id='neg_seq_input'>
      <h4>Negative sequences</h4>
      <table class="inputs">
        <tr><th>Database</th><th>Source</th><th>Sequence Count</th></tr>
        <tr>
          <td id="ins_negseq_name"></td>
          <td id="ins_negseq_source"></td>
          <td id="ins_negseq_count"></td>
        </tr>
      </table>
      </div>
      <script>
      {
        if (data['options']['neg_sequences']) {
          var db = data['negative_sequence_db'];
          if (!db['name']) db['name'] = name_from_source(db['source']);
          $("ins_negseq_name").innerHTML = db['name'];
          $("ins_negseq_source").innerHTML = db['source'];
          $("ins_negseq_count").innerHTML = db['count'];
        }
        else {
          $('neg_seq_input').style.display='none';
        }
      }
      </script>
      <h4>Motifs</h4>
      <table id="motif_dbs" class="inputs">
        <thead>
          <tr><th>Database</th><th>Source</th><th>Motif Count</th></tr>
        </thead>
        <tbody></tbody>
      </table>
      <script>
      {
        var tbl = $('motif_dbs');
        var tbody = tbl.tBodies[0];
        while (tbody.rows.length > 0) {
          tbody.deleteRow(0);
        }
        var motif_dbs = data['motif_dbs'];
        for (var i = 0; i < motif_dbs.length; i++) {
          var db = motif_dbs[i];
          var row = tbody.insertRow(tbody.rows.length);
          add_text_cell(row, db['name']);
          add_text_cell(row, db['source']);
          add_text_cell(row, db['count']);
        }
      }
      </script>

      <h4>Other Settings</h4>
      <table id="tbl_settings" class="inputs hide_advanced">
	<tr>
	  <th>Objective Function</th>
	  <td id="opt_obj"></td>
	</tr>
	<tr>
	  <th>Convert Motifs to Different Alphabet?</th>
	  <td id="opt_xalph"></td>
	</tr>
	<tr>
	  <th>Motif Pseudo-Counts</th>
	  <td id="opt_motif_pseudo"></td>
	</tr>
	<tr>
	  <th>Required sequence length</th>
	  <td id="opt_seqlen"></td>
	</tr>
	<tr>
	  <th>Site Scoring Method</th>
	  <td id="opt_use_pvalues"></td>
	</tr>
	<tr>
	  <th>Score Threshold</th>
	  <td id="opt_score"></td>
	</tr>
	<tr>
	  <th>Optimize Score Threshold?</th>
	  <td id="opt_optimize_score"></td>
	</tr>
	<tr>
	  <th>Minimum Region Size</th>
	  <td id="opt_minreg"></td>
	</tr>
	<tr>
	  <th>Maximum Region Size</th>
	  <td id="opt_maxreg"></td>
	</tr>
	<tr>
	  <th>Strand Handling</th>
	  <td id="opt_strands"></td>
	</tr>
	<tr>
	  <th>Plotting of Matches on Negative Strand</th>
	  <td id="opt_flip"></td>
	</tr>
	<tr>
	  <th>Sequence IDs Included in Output?</th>
	  <td id="opt_noseq"></td>
	</tr>
	<tr>
      </table>
      <script> make_other_settings(); </script>

    </div>

    <div id="info_sec" class="bar">
      <div class="subsection">
        <a name="version"/>
        <h5>CentriMo version</h5>
        <span id="ins_version"></span>
        (Release date: <span id="ins_release"></span>)
        <script>
          $("ins_version").innerHTML = data["version"];
          $("ins_release").innerHTML = data["release"];
        </script> 
      </div>
      <div class="subsection">
        <a name="command" />
        <h5>Command line summary</h5>
        <textarea id="cmd" rows="5" style="width:100%;" readonly="readonly">
        </textarea>
        <script>$("cmd").value = data["cmd"].join(" ");</script>
      </div>
    </div>
  </body>
</html>
